RFR: 8285773: Replace Algorithms.eatMemory(...) with WB.fullGC() in vmTestbase/gc/gctests/ReferencesGC/ReferencesGC.java
Thomas Schatzl
tschatzl at openjdk.java.net
Fri Apr 29 08:09:39 UTC 2022
On Fri, 29 Apr 2022 08:02:28 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Please review this fix.
>> OOME might happen in any thread, causing test failure.
>>
>> The reference tests provoke OOME only to force reference clearing.
>>
>> The possible fix is to force it directly with WB.fullGC(). Another possible fix would be to throw SkippedException in DefaultUncaughtExceptionHandler. However, it might also cause OOME and still fail.
>>
>> We might also want to verify that a last-ditch GC or something similar is called for each GC.
>
> test/hotspot/jtreg/vmTestbase/gc/gctests/ReferencesGC/ReferencesGC.java line 134:
>
>> 132: }
>> 133:
>> 134: // WB.fullGC() is a lst ditch GC which should provoke
>
> Suggestion:
>
> // WB.fullGC() is a last ditch GC which should provoke
Maybe just write: "`WB.fullGC()` is guaranteed to clear all kinds of weak references."
-------------
PR: https://git.openjdk.java.net/jdk/pull/8440
More information about the hotspot-gc-dev
mailing list