On Sat, 13 Sep 2025 00:19:23 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

> Improved test stability. See first comment for details.
> 
> Tested by running the test 25 times with every GC on every supported platform 
> and also combined with -Xcomp.

This test has proven very temperamental and unstable, so I've made a number of 
changes to address the stability issues.

One realization while working on this was the ZGC youngGen using up the entire 
heap before a GC was forced, finally promoting to the oldgen and triggering the 
notification. This put the test at risk of unexpected OOMEs. G1 had a similar 
issue with delays getting objects promoted. The main way this has been 
addressed is by adding periodic System.gc() calls. It's not necessary for each 
call to force the promotion of all objects, but only that they get there over 
time as more calls are made.

In order to avoid OOME due to the memory consumption loop running faster than 
the notification can be handled, the test now periodically queries the pool to 
see if more than 50% has been used. Once that happens it blocks until the 
notification has been received.

Another tweak was to bump up the threshold to 20%, allowing for using a smaller 
heap (128m instead of 256m) without risk of exceeding the threshold before the 
notification is setup, which resulted in timeouts.

The test had no checks to guarantee that the notification was being setup on 
the oldgen. For most GCs it got lucky and ended up with the right pool. 
However, for Shenandoah it was not using the right pool. In order to avoid this 
issue and detect errors with the notification setup, the notification is setup 
on pools with specific names so we are sure to get the right one.

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

PR Comment: https://git.openjdk.org/jdk/pull/27266#issuecomment-3287233520

Reply via email to