RFR: 8289838: ZGC: OOM before clearing all SoftReferences
Thomas Schatzl
tschatzl at openjdk.org
Wed Oct 12 11:05:07 UTC 2022
On Tue, 11 Oct 2022 09:48:39 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
> should_clear_soft_references() in mainline ZGC is based purely on the cause of the GC, but the GC cause being used to catch that we need to clear soft references is asynchronous. Another GC could start an instant before it is requested, such as a metadata threshold GC for example. Then the metadata threshold GC will be used instead.
>
> Even if the other async GC that was requested is also of the kind that requires soft references to be cleared, such as a concurrently requested _z_allocation_stall GC, it is possible that the async GC request is performed after a soft reference was created, after a concurrent thread requests a _z_allocation_stall GC, but before that GC has reached mark_start, implying that the sequence number will look like it already got to run an entire GC before throwing, while in fact it did not.
Lgtm.
-------------
Marked as reviewed by tschatzl (Reviewer).
PR: https://git.openjdk.org/jdk/pull/10646
More information about the hotspot-gc-dev
mailing list