<div dir="ltr">Hi,<div><br></div><div>I have been working on adding support for CDS archived heap regions in Shenandoah GC,<br>in the way similar to existing non-G1 GC policies like serial, parallel and epsilon,<br>which "load" the archived heap regions from the CDS archive file into the heap,</div><div>as against the G1 GC  which "maps" the archived heap regions.<br>But I soon realized that Shenandoah being a region based collector, is not well positioned to</div><div>use the existing API [1] that allocates memory regions in the heap for the archived heap regions</div><div><br></div><div>Since G1 is also a region based collector, I started looking at how G1 performs mapping of <br>archived heap regions, and realized shenandoah can do the same as well.</div><div><br></div><div>But the mechanism and the APIs used for mapping the heap regions in G1 GC are tightly coupled to G1's internal implementation.</div><div>I felt there is significant room for improving the APIs used for mapping the heap regions,</div><div>thereby reducing the complexity and the coupling between the CDS and the GC policy being used.</div><div>While working on the new APIs, I realized I can also use them for non-G1 GC policies,</div><div>in a manner similar to the APIs that "load" the archived heap regions.</div><div><br></div><div>So now I have an implementation for mapping archived heap regions which uses uniform APIs across</div><div>all existing GC policies that currently support use of archived heap regions.</div><div>I am pretty confident I would be able to use the same set of APIs for Shenandoah GC, and hopefully </div><div>it would work for ZGC as well (if anyone takes that up).<br><br>I would be raising a PR pretty soon for feedback as basic testing completes.</div><div>For those interested in looking at the code before, it is sitting in my branch [2],<br></div><div><br>[1] <a href="https://github.com/openjdk/jdk/blob/f84b0ad07c73c305d21c71ec6b8195dc1ee31a3e/src/hotspot/share/gc/shared/collectedHeap.hpp#L518" target="_blank">https://github.com/openjdk/jdk/blob/f84b0ad07c73c305d21c71ec6b8195dc1ee31a3e/src/hotspot/share/gc/shared/collectedHeap.hpp#L518</a></div><div><br></div><div>[2] <a href="https://github.com/openjdk/jdk/compare/master...ashu-mehra:jdk:archived-heap-support-v2">https://github.com/openjdk/jdk/compare/master...ashu-mehra:jdk:archived-heap-support-v2</a></div><div><br></div><div>Regards,<br><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr">Ashutosh Mehra</div></div></div></div></div>