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

Aleksey Shipilev shade at redhat.com
Mon Apr 19 12:46:38 UTC 2021

Original test bug:

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());


Testing: affected test in tier1 (used to fail, now passes)


More information about the jdk8u-dev mailing list