RFR: 8310160: Make GC APIs for handling archive heap objects agnostic of GC policy
Ashutosh Mehra
duke at openjdk.org
Fri Jun 16 14:44:00 UTC 2023
On Fri, 16 Jun 2023 14:26:09 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:
> This PR adds GC APIs to be implemented by all collectors for proper handling of archive heap space. Currently only G1 is updated to use these APIs which just involves renaming the existing G1 APIs.
> In addition to that filemap.cpp is updated to replace calls to `G1CollectedHeap::heap()` with `Universe::heap()` to avoid G1 specific code as much as possible.
>
> At many places in filemap.cpp heap range is requested from GC. All collectors except ZGC have contiguous heap and set `CollectedHeap::_reserved` to the heap range, so it can be easily exposed to the CDS code. This is done in this patch through `CollectedHeap::reserved` API. But for ZGC the heap can be discontiguous which makes it tricky to expose the heap range.
> Another point to note is that most of the usage for heap range is for logging purpose, but there is one place where it is used for setting the `mapping_offset` in `FileMapInfo::write_region()` based on the heap start. So purely based on the functional requirement, we only need the heap start address, not the range.
>
> To keep things simple and considering ZGC does not currently support archive heap, i refrained from tackling the issue of discontiguous heap range in this PR.
fyi - @iklam @tschatzl
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14520#issuecomment-1594808396
More information about the hotspot-dev
mailing list