Uniform APIs for using archived heap regions

Ashutosh Mehra asmehra at redhat.com
Wed Nov 2 19:33:08 UTC 2022


Hi,

I have been working on adding support for CDS archived heap regions in
Shenandoah GC,
in the way similar to existing non-G1 GC policies like serial, parallel and
epsilon,
which "load" the archived heap regions from the CDS archive file into the
heap,
as against the G1 GC  which "maps" the archived heap regions.
But I soon realized that Shenandoah being a region based collector, is not
well positioned to
use the existing API [1] that allocates memory regions in the heap for the
archived heap regions

Since G1 is also a region based collector, I started looking at how G1
performs mapping of
archived heap regions, and realized shenandoah can do the same as well.

But the mechanism and the APIs used for mapping the heap regions in G1 GC
are tightly coupled to G1's internal implementation.
I felt there is significant room for improving the APIs used for mapping
the heap regions,
thereby reducing the complexity and the coupling between the CDS and the GC
policy being used.
While working on the new APIs, I realized I can also use them for non-G1 GC
policies,
in a manner similar to the APIs that "load" the archived heap regions.

So now I have an implementation for mapping archived heap regions which
uses uniform APIs across
all existing GC policies that currently support use of archived heap
regions.
I am pretty confident I would be able to use the same set of APIs for
Shenandoah GC, and hopefully
it would work for ZGC as well (if anyone takes that up).

I would be raising a PR pretty soon for feedback as basic testing completes.
For those interested in looking at the code before, it is sitting in my
branch [2],

[1]
https://github.com/openjdk/jdk/blob/f84b0ad07c73c305d21c71ec6b8195dc1ee31a3e/src/hotspot/share/gc/shared/collectedHeap.hpp#L518

[2]
https://github.com/openjdk/jdk/compare/master...ashu-mehra:jdk:archived-heap-support-v2

Regards,
Ashutosh Mehra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20221102/c41967a1/attachment.htm>


More information about the hotspot-dev mailing list