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

Allow archived Java strings to be moved by GC

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • b17

      Currently, the archived java strings are mapped in the G1 "closed archive" region:

      https://github.com/openjdk/jdk/blob/574b48c6925ebfb31345fc46c7d23aa4153f99b0/src/hotspot/share/gc/g1/heapRegionType.hpp#L80-L92

      Objects in the closed archive region never move. This allows the _shared_table in stringTable.cpp to encode each archived string using a constant 32-bit integer (E.g., in the case of uncompressed oops, this is an offset from the lower end of the heap).

      However, if we want to support mapping of the CDS heap in other collectors (JDK-8296263), it will be too complex to require each collector to implement something equivalent to the closed archive region.

      ================
      Proposal:

      We should change stringTable.cpp to store the archived strings in an objArray. That way, it's possible for the collector to move the archive strings. We can also get rid of the closed archive region from G1.

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

              Created:
              Updated:
              Resolved: