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

Relocate CDS archived regions to the top of the G1 heap

XMLWordPrintable

    • b18

      When the runtime heap and dump time heap have different sizes, it's possible that the archived heap regions are mapped to the middle of the runtime heap. Because the archived heap regions are pinned, this could reduce the size of the largest "humongous" array allocation.

      In the worst case, the maximum allocatable array length may be half of the optimal value.

      The condition that needs to be changed is here:

      https://github.com/openjdk/jdk/blob/104e925dfdac0af3b1c6862f9a7d3442484f9241/src/hotspot/share/memory/filemap.cpp#L1835

          if (!CompressedOops::is_in(range)) {
            log_info(cds)("CDS heap data need to be relocated because");
            log_info(cds)("the desired range " PTR_FORMAT " - " PTR_FORMAT, p2i(range.start()), p2i(range.end()));
            log_info(cds)("is outside of the heap " PTR_FORMAT " - " PTR_FORMAT, p2i(CompressedOops::begin()), p2i(CompressedOops::end()));
            _heap_pointers_need_patching = true;
      >>>> Add
          } else if (header()->heap_end() != CompressedOops::end()) {
           log_info(cds)("CDS heap data need to be relocated to the end the runtime heap to reduce fragmentation");
        }
       <<<< end

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: