On Thu, 6 Aug 2026 23:17:57 GMT, Shiv Shah <[email protected]> wrote:

>> The test fails intermittently with OutOfMemoryError under -Xcheck:jni 
>> -XX:+UseZGC (the original report also had -XX:+ZGenerational, which is gone 
>> since JEP 490). Reproduced at about 2%: 6 of 300 runs on four hosts, all
>> with the original signature.
>> 
>> GC logs from the failing runs show the 512m heap reaching 100% with ZGC in 
>> back-to-back allocation-stall collections that reclaim almost nothing, 
>> ending in the OOME while Allocator.helper grows its list. The sampling
>> agent holds jweaks on the sampled objects, which keeps the transient garbage 
>> alive until a major collection runs. The test's actual live set is only 
>> about 20MB.
>> 
>> Fix: bump the test heap from 512m to 1g.
>> 
>> Testing: 500 default-config runs at 1g all pass. The failing configuration 
>> at 1g (501 runs) had 2 OOME failures, about 0.4% vs 2% at 512m.
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Shiv Shah has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Remove bug tag and update copyright year

test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java
 line 33:

> 31:  * @requires vm.jvmti
> 32:  * @compile HeapMonitorThreadTest.java
> 33:  * @run main/othervm/native/timeout=480 -Xmx1g -agentlib:HeapMonitorTest 
> MyPackage.HeapMonitorThreadTest

Should we enable the gc log by default. That will be convenient to diagnose the 
similar OOME issue if the same problem occur again.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32229#discussion_r3755871418

Reply via email to