RFR: 8296263: Uniform APIs for using archived heap regions

Ioi Lam iklam at openjdk.org
Thu Nov 3 20:02:29 UTC 2022


On Thu, 3 Nov 2022 16:06:47 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:

> This is an attempt to unify the two different approaches for using archived heap regions. Main goal is to restructure and modify the code to have a single set of GC APIs that can be called for using archived heap regions.
> 
> In current state, the VM either tries to "map" (for G1) or "load" (for non-G1 GC policies) the archived heap regions into the java heap.
> When mapping, the VM determines the address range in the java heap where the archived regions should be mapped. It tries to map the regions towards the end of the heap. The APIs used for this purpose are G1 specific.
> When loading, the VM asks the GC to provide a chunk of memory from the heap, into which it reads the contents of the archived heap regions. The APIs used are GC policy agnostic but challenging to use for region based collectors.
> 
> This PR attempts to add new set of GC APIs that can be used by the VM to reserve space in the heap for mapping the archived heap regions. It combines the good parts of the two existing approaches. Similar to the "loading" API, in this new approach VM is not responsible for determining the mapping address. That responsibility always resides with the GC policy. This also allows the flexibility for the GC implementation to decide where and how to reserve the space for the archived regions. For instance, G1 implementation can continue to attempt to allocate the space towards the end of the heap.
> This PR also provides the implementation of the new APIs for all the existing GC policies that currently support archived heap regions viz G1, serial, parallel and epsilon.

Hi Ashutosh, I've been trying out your patch and reading the code. So far, I found a few problems:

- With debug VM, `java -Xlog:cds -XX:+UseSerialGC --version` spends a long time at VM exit to verify the heap
- I cannot run the jtreg tests with a fastdebug or slowdebug VM in agentvm mode. I.e., `jtreg .... -agentvm HelloTest.java`. Product VM works fine in agentvm mode.
- These two test cases crash with a product VM:
  - runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java
  - runtime/cds/appcds/sharedStrings/SharedStringsStress.java

-------------

PR: https://git.openjdk.org/jdk/pull/10970


More information about the hotspot-dev mailing list