RFR: 8373945: vmTestbase eatMemory/ClassUnloader provoke OOME to force GC and might cause GC in other threads [v5]
Chris Plummer
cjplummer at openjdk.org
Mon Dec 22 03:20:01 UTC 2025
On Sat, 20 Dec 2025 04:47:44 GMT, SendaoYan <syan at openjdk.org> wrote:
>> test/hotspot/jtreg/vmTestbase/gc/gctests/LargeObjects/large001/large001.java line 154:
>>
>>> 152:
>>> 153: // Drop all references to the class and try to unload it
>>> 154: WhiteBox.getWhiteBox().fullGC();
>>
>> Just to be clear, this is now no different than the `unloader.unloadClass()` call below in terms of how it is implemented. I wonder why the author originally used eatMemory() here and unloadClass() below.
>
> It seems that, the references is non null at the first time. So it will not unload the classes actually,
I understand that difference. What I meant is before it used to use eatMemory() above to attempt to force class unloading (and you are correct, there should be none) and then below it was using unloadClass(), which essentially was the same as eatMemory(). I'm not sure why two different APIs where use. I'm wondering if we should change the test to just always use WB.fullGC() both here and below where the unloadClass() call. is being made.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28891#discussion_r2638494890
More information about the serviceability-dev
mailing list