RFR: 8373022: Increase initial heap size for test which assumes no GC

Chris Plummer cjplummer at openjdk.org
Thu Dec 4 21:35:07 UTC 2025


On Wed, 3 Dec 2025 14:59:10 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

> Hello,
> 
>  If the initial heap size is set too low in the following tests a GC might run, which will interfere with the tests and migh cause them to fail. To solve this, we should run the tests with a bumped initial heap size so that the GC does not interfere.
>  
> Test originally failed when run with `-XX:InitialRAMPercentage=0`. We now explicitly set `-XX:InitialHeapSize=100M` and they now always pass.
> 
> Testing:
> * Rerun 10 times with Serial and Parallel for each test and they all pass

test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java line 66:

> 64:             // Setting the initial heap size to a reasonably high number avoids
> 65:             // running a GC.
> 66:             theApp = LingeredApp.startApp(gc, "-XX:InitialHeapSize=100M");

This test does tries to scan a section of the java heap. When a GC happens, this section becomes empty, so the expected output is not present. Your fix seems reasonable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28637#discussion_r2590648795


More information about the serviceability-dev mailing list