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

Make CDS archived heap regions usable even if compressed oop encoding has changed

    Details

    • Subcomponent:
    • Resolved In Build:
      b09

      Description

      At runtime, if you use a maximum heap size (-Xmx) setting that's different than the one used at CDS archive creation time, the archived heap regions may fail to map. The reason is the archived heap regions are hard-coded to a specific compressed oop encoding scheme

      This causes degradation in start-up.

      For the related code, see:

      http://hg.openjdk.java.net/jdk/jdk/file/5cc6acb1d6b6/src/hotspot/share/memory/filemap.cpp#l877

      To fix this, we should patch/relocate the archived heap regions to make it compatible with the runtime compressed oop encoding. Preliminary result is encouraging.

      Test case:

      # dump archive
      java -Xshare:dump -Xmx2000m

      # same compressed oop encoding
      java -Xshare:on -Xmx2000m -Xlog:cds -version

      # different compressed oop encoding
      java -Xshare:on -Xmx2090m -Xlog:cds -version

      (The archive is dumped with UnscaledNarrowOop mode. At run time, if -Xmx2090m is specified, ZeroBasedNarrowOop is used instead).

      OLD same 34.45 ms +- 0.51%
      OLD diff 47.76 ms +- 0.61% <<<<< 13.3 ms degradation!
      NEW same 34.58 ms +- 0.94%
      NEW diff 35.09 ms +- 0.24%

      Patch: http://cr.openjdk.java.net/~iklam/jdk12/8208658-relocate-archived-heap-regions.v00/

      Note that without this fix, start-up time degrades 13.3ms when compressed oop encoding has changed. With this fix, the degradation is only 0.5ms, which is the cost of relocating/patching the archived heap regions.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iklam Ioi Lam
                Reporter:
                iklam Ioi Lam
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: