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
Tue May 24 22:49:54 UTC 2022


On Sun, 22 May 2022 22:14:45 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

> 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.

@ albertnetymk Thank you! I'm fine with your proposal, updated the test and put your comments into JIRA issue for history.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8829



More information about the hotspot-gc-dev mailing list