RFR: 8377347: jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java intermittent OOME [v2]

SendaoYan syan at openjdk.org
Tue Feb 10 12:11:26 UTC 2026


On Tue, 10 Feb 2026 08:29:34 GMT, SendaoYan <syan at openjdk.org> wrote:

>> test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java line 64:
>> 
>>> 62:             } catch (java.lang.OutOfMemoryError e) {
>>> 63:                 System.gc();
>>> 64:                 whitebox.fullGC();
>> 
>> Why manually invoking GC after OOM? Since we are not dropping refs to live-obj, I can't see that it will have any impact.
>> 
>> Do you encounter test failures without these two lines?
>
> I was wondering the implicit GC after OOM does only free the young area. The intention of whitebox.fullgc is free the young and old heap. This is make sure there will enough free heap memory to continue the following test.
> 
> I will try to remove these two lines and run this test later, to verify that does these two lines are redunt.
> 
> Thanks.

I remove the explict System.gc() and whitebox.fullgc() and then run this test 10k times on the same machin which observed intermittent OOME, all tests passed.

So I think the explict gc invoke do not needed. I have remove it. Thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29601#discussion_r2787577393


More information about the hotspot-gc-dev mailing list