RFR: 8296263: Uniform APIs for using archived heap regions
Ashutosh Mehra
duke at openjdk.org
Thu Nov 3 16:24:04 UTC 2022
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.
-------------
Commit messages:
- Remove whitespace in filemap.cpp
- Clean up unused code
- Fix TestTracePageSizes to account for page size mismatch when heap
- Differentiate between GC policies that can move archive regions around
- Support for mapping archived heap with serial gc
- Support for mapping archived heap with parallel gc
- Support for mapping archived heap with epsilon gc
- Add APIs for mapping archive heap regions and update G1GC to use new
Changes: https://git.openjdk.org/jdk/pull/10970/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10970&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8296263
Stats: 1814 lines in 39 files changed: 622 ins; 894 del; 298 mod
Patch: https://git.openjdk.org/jdk/pull/10970.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10970/head:pull/10970
PR: https://git.openjdk.org/jdk/pull/10970
More information about the hotspot-dev
mailing list