JDK-8301106 : Allow archived Java strings to be moved by GC
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-01-25
  • Updated: 2023-04-06
  • Resolved: 2023-03-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b17Fixed
Related Reports
Blocks :  
Description
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.

Comments
Changeset: b524a741 Author: Ioi Lam <iklam@openjdk.org> Date: 2023-03-29 23:42:52 +0000 URL: https://git.openjdk.org/jdk/commit/b524a74165a901383c00fbfcbc3e842c0df02398
29-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/12607 Date: 2023-02-16 19:14:15 +0000
16-02-2023