RFR: 8289838: ZGC: OOM before clearing all SoftReferences
Erik Österlund
eosterlund at openjdk.org
Tue Oct 11 09:54:05 UTC 2022
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.
-------------
Commit messages:
- 8289838: ZGC: OOM before clearing all SoftReferences
Changes: https://git.openjdk.org/jdk/pull/10646/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10646&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8289838
Stats: 8 lines in 1 file changed: 8 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/10646.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10646/head:pull/10646
PR: https://git.openjdk.org/jdk/pull/10646
More information about the hotspot-gc-dev
mailing list