RFR: 8373945: vmTestbase eatMemory/ClassUnloader provoke OOME to force GC and might cause GC in other threads [v5]

SendaoYan syan at openjdk.org
Wed Dec 24 08:15:41 UTC 2025


On Mon, 22 Dec 2025 03:10:42 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

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

I have changed the test always use WhiteBox.fullGC() instead of call unloadClass(). This test has been verified locally,

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28891#discussion_r2645091951


More information about the serviceability-dev mailing list