RFR: 8376051: gc/stress/TestStressG1Uncommit.java fails assertLessThan: expected that xxx < xxx

Thomas Schatzl tschatzl at openjdk.org
Thu Jan 22 08:10:50 UTC 2026


On Thu, 22 Jan 2026 06:33:13 GMT, SendaoYan <syan at openjdk.org> wrote:

> Hi all,
> 
> [JDK-8238686](https://bugs.openjdk.org/browse/JDK-8238686) change the default value MinHeapFreeRatio/MaxHeapFreeRatio to 0/100, this change make G1 never uncommit heap memory to OS system, this will make test test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java fails "assertLessThan: expected that xxx < xxx", and the tested java process never print "Uncommit regions" which checked by this test.
> 
> This PR set MinHeapFreeRatio/MaxHeapFreeRatio to the original value 40/70 to make this test work expectly, and Use WhileBox.fullGC() instead of System.gc() which will make test more robustness.
> 
> Change has been verified locally on linux-x64 by run this tests both with release build and fastdebug build.

Looks good.

> [JDK-8238686](https://bugs.openjdk.org/browse/JDK-8238686) change the default value MinHeapFreeRatio/MaxHeapFreeRatio to 0/100, this change make G1 never uncommit heap memory to OS system,

Fwiw, G1 will still uncommit memory to give back to the OS, just not automatically implied by full gcs.

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

Marked as reviewed by tschatzl (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29357#pullrequestreview-3691122823
PR Comment: https://git.openjdk.org/jdk/pull/29357#issuecomment-3783074926


More information about the hotspot-gc-dev mailing list