JDK-8298048 : Combine CDS archive heap into a single block
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-12-02
  • Updated: 2022-12-12
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
In JDK 20, the CDS archive can consists of up to 4 blocks of memory

- one or two blocks of "open" type, and one or two blocks of "closed" type

After JDK-8296344, we will always have a single block of "open" and a single block of "closed".

Still, having the two separate blocks makes the runtime mapping code complicated. Also, G1 has special handling for the "archive regions" used for mapping these blocks. See

https://github.com/openjdk/jdk/blob/6065696e5df2cde8c313083217ead3417d04c365/src/hotspot/share/gc/g1/heapRegionType.hpp#L80-L91

It's unclear that such special handling has any performance benefit. Objects in the CDS archive heap are expected to have a long lifecycle and are infrequently modified. It should be sufficient to place these objects into the old generation (for any generational collector, not just G1).

********************************
Proposal:

- Combine all objects in the CDS archive heap into a single, contiguous block.

- Remove "archive region" handling from G1

- At runtime, allocate one or several contiguous G1 regions for mapping the CDS archive heap. These regions are marked as in the old generation.

*********************************
Similar mapping code will be implemented in other collectors in follow-up RFEs.