RFR: 8346572: Check is_reserved() before using ReservedSpace instances
William Kemper
wkemper at openjdk.org
Thu Jan 16 17:25:38 UTC 2025
On Thu, 16 Jan 2025 16:32:02 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> There are a number of places where we reserve memory and create a ReservedSpace, and after the use the created instance without checking if the memory actually got reserved and the instance got initialized. This mostly affects code paths during JVM initialization and fixing this will mostly give better error handling and tracing.
>>
>> The patch also includes some minor restructuring to get early returns and remove redundant null checks after calls to new.
>>
>> Tested tier1 and GHA, but will run more tests when/if this gets accepted.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 391:
>
>> 389:
>> 390: // Maybe Shenandoah wants to check the the memory got reserved here?
>> 391:
>
> Thanks for tagging us Stefan. There seem to be a few places where we might want to check & guard for failure to reserve the space. It might make sense to clean up these failure paths in a separate ticket. cc @earthling-amzn @shipilev ?
The method `ShenandoahHeap::reserve` should `vm_exit_during_initialization` if the memory isn't reserved. Between that and the collection set memory here, I believe that would cover Shenandoah's cases.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22825#discussion_r1918930136
More information about the hotspot-gc-dev
mailing list