RFR: 8289838: ZGC: OOM before clearing all SoftReferences [v2]

Erik Österlund eosterlund at openjdk.org
Wed Nov 2 14:49:29 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.

Erik Österlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:

 - Merge branch 'master' into 8289838_soft_ref_trouble
 - 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=01
  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