[8u] RFR (XS) 8183910: gc/arguments/TestAggressiveHeap.java fails intermittently

Severin Gehwolf sgehwolf at redhat.com
Mon Apr 19 13:16:02 UTC 2021


On Mon, 2021-04-19 at 14:46 +0200, Aleksey Shipilev wrote:
> Original test bug:
>    https://bugs.openjdk.java.net/browse/JDK-8183910
>    https://hg.openjdk.java.net/jdk/jdk/rev/63f8bc358cca
> 
> This test reliably fails for me in 8u on my large development machine: it reserves too much memory,
> which is not available with lots of concurrent tests. The patch does
> not apply to 8u due to context differences. I had to reapply both chunks by hand.
> 
> 8u change is identical otherwise:
> 
> diff -r 9da639b96992 test/gc/arguments/TestAggressiveHeap.java
> --- a/test/gc/arguments/TestAggressiveHeap.java Sun Nov 02 18:43:00 2014 +0300
> +++ b/test/gc/arguments/TestAggressiveHeap.java Mon Apr 19 14:44:03 2021 +0200
> @@ -49,17 +49,22 @@
>       private static final String option = "-XX:+AggressiveHeap";
> 
>       // Option requires at least 256M, else error during option processing.
>       private static final long minMemory = 256 * 1024 * 1024;
> 
> +    // Setting the heap to half of the physical memory is not suitable for
> +    // a test environment with many tests running concurrently, setting to
> +    // half of the required size instead.
> +    private static final String heapSizeOption = "-Xmx128M";
> +
>       // bool UseParallelGC := true {product}
>       private static final String parallelGCPattern =
>           " *bool +UseParallelGC *:= *true +\\{product\\}";
> 
>       private static void testFlag() throws Exception {
>           ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
> -            option, "-XX:+PrintFlagsFinal", "-version");
> +            option, heapSizeOption, "-XX:+PrintFlagsFinal", "-version");
> 
>           OutputAnalyzer output = new OutputAnalyzer(pb.start());
> 
>           output.shouldHaveExitValue(0);

This looks fine.

Thanks,
Severin



More information about the jdk8u-dev mailing list