Currently there are two separate G1ArchiveRegionMaps used for the open and closed archived heap regions:
g1Allocator.cpp:G1ArchiveRegionMap G1ArchiveAllocator::_closed_archive_region_map;
g1Allocator.cpp:G1ArchiveRegionMap G1ArchiveAllocator::_open_archive_region_map;
As Thomas suggested below, we can use a merged map for both open and closed archive heap regions:
- this is a cleanup request for the future: is there a reason to have
separate tables for open and closed archives? I understand that the
code happened this way because these types of archives were added at
different times, but in my understanding a region in that table can
either be one or the other, and by using a uint8_t as per-region entry
we can even save space.
It is safe to using a single map for both open and closed archive regions since there is no overlapping for the archived heap memory ranges. With the merged map, we can also simplify the following APIs and remove the bool arguments (also suggested by Thomas):
static inline void clear_range_archive(MemRegion range, bool open);
g1Allocator.cpp:G1ArchiveRegionMap G1ArchiveAllocator::_closed_archive_region_map;
g1Allocator.cpp:G1ArchiveRegionMap G1ArchiveAllocator::_open_archive_region_map;
As Thomas suggested below, we can use a merged map for both open and closed archive heap regions:
- this is a cleanup request for the future: is there a reason to have
separate tables for open and closed archives? I understand that the
code happened this way because these types of archives were added at
different times, but in my understanding a region in that table can
either be one or the other, and by using a uint8_t as per-region entry
we can even save space.
It is safe to using a single map for both open and closed archive regions since there is no overlapping for the archived heap memory ranges. With the merged map, we can also simplify the following APIs and remove the bool arguments (also suggested by Thomas):
static inline void clear_range_archive(MemRegion range, bool open);