Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8214277

Use merged G1ArchiveRegionMap for open and closed archive heap regions

XMLWordPrintable

    • gc
    • b06

      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);

            tschatzl Thomas Schatzl
            jiangli Jiangli Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: