On Thu, 6 Aug 2026 05:52:57 GMT, Shiv Shah <[email protected]> wrote: > The test failed intermittently with OutOfMemoryError under -Xcheck:jni > -XX:+UseZGC (originally reported with -XX:+ZGenerational, which no longer > exists after JEP 490). Reproduced on current builds at a stable 2% rate: 6 of > 300 runs on four different 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 test's live set is > only about 20MB - five threads that each retain one ~2MB list and build one > more - so the heap fills with garbage the in-flight concurrent cycle cannot > yet prove dead: allocation outpaces concurrent collection at this heap size, > with the sampling agent and -Xcheck:jni overhead on top. It is not a leak: > the workload is bounded by construction, and the agent stores sampled objects > via JNI weak global refs only (libHeapMonitorTest.cpp). > > So I try to fix this by raise the test heap from -Xmx512m to -Xmx1g to give > the concurrent > collector headroom, and add the bug id to @bug. > > Testing: 500 repeats of the failing configuration (-Xcheck:jni -XX:+UseZGC, > linux-x64-debug) all pass, where the 2% rate would have predicted about 10 > failures; 100 repeats of the default configuration all pass. A gc-logged run > recording peak occupancy against the new limit is in progress; I'll post the > number here. > > > > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
Changes requested by lmesnik (Reviewer). test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java line 29: > 27: /** > 28: * @test > 29: * @bug 8323421 No need to add test fixes as a bug entries here. It is the tag for product bugs related to this test. See: https://openjdk.org/jtreg/faq.html#when-should-i-update-the-bug-entry-in-a-test-description Also, please update copyright year. ------------- PR Review: https://git.openjdk.org/jdk/pull/32229#pullrequestreview-4877969101 PR Review Comment: https://git.openjdk.org/jdk/pull/32229#discussion_r3731664948
