RFR: 8286737: Test vmTestbase/gc/gctests/WeakReference/weak006/weak006.java fails: Last soft reference has not been cleared
Leonid Mesnik
lmesnik at openjdk.java.net
Sun May 22 22:21:15 UTC 2022
The problem is that PSScavenge::invoke() (young gen GC) never tries to clear soft references.
The fix is to update the clear_all_soft_refs to be the same as in full GC if scavenge is run as a part of full GC. Test passed before https://bugs.openjdk.java.net/browse/JDK-8285951 Replace Algorithms.eatMemory(...) with WB.fullGC() in vmTestbase_vm_gc_ref tests because the eatMemory causes a lot of full GC and all references were propagated into old gen.
The failed mem allocation also runs full GC with clear_all_soft_refs = true before throwing OOME so it should be also ok.
-------------
Commit messages:
- 8286737
Changes: https://git.openjdk.java.net/jdk/pull/8829/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8829&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8286737
Stats: 58 lines in 5 files changed: 17 ins; 30 del; 11 mod
Patch: https://git.openjdk.java.net/jdk/pull/8829.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8829/head:pull/8829
PR: https://git.openjdk.java.net/jdk/pull/8829
More information about the hotspot-gc-dev
mailing list