# HG changeset patch # User iignatyev # Date 1530132232 25200 # Node ID 9b0e2937fac57224923c4ed55263352e2d1af6b4 # Parent efaf00d8858a01e7fe412a2489b3b33b0b09a474 8199265: java/util/Arrays/TimSortStackSize2.java fails with OOM Reviewed-by: dholmes diff -r efaf00d8858a -r 9b0e2937fac5 test/jdk/java/util/Arrays/TimSortStackSize2.java --- a/test/jdk/java/util/Arrays/TimSortStackSize2.java Wed Jun 27 21:18:33 2018 +0100 +++ b/test/jdk/java/util/Arrays/TimSortStackSize2.java Wed Jun 27 13:43:52 2018 -0700 @@ -24,6 +24,8 @@ /* * @test * @bug 8072909 + * @summary Test TimSort stack size on big arrays + * @key intermittent * @library /lib/testlibrary /test/lib * @modules java.management * java.base/jdk.internal @@ -33,8 +35,6 @@ * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI TimSortStackSize2 - * @summary Test TimSort stack size on big arrays - * @key intermittent */ import java.util.ArrayList; import java.util.Arrays; @@ -64,22 +64,20 @@ */ try { Boolean compressedOops = WhiteBox.getWhiteBox() - .getBooleanVMFlag("UseCompressedOops"); + .getBooleanVMFlag("UseCompressedOops"); long memory = (compressedOops == null || compressedOops) ? 385 : 770; - final String xmsValue = "-Xms" + memory + "m"; - final String xmxValue = "-Xmx" + memory + "m"; + final String xmsValue = "-Xms" + memory + "m"; + final String xmxValue = "-Xmx" + 2 * memory + "m"; System.out.printf("compressedOops: %s; Test will be started with \"%s %s\"%n", compressedOops, xmsValue, xmxValue); - ProcessBuilder processBuilder = ProcessTools - .createJavaProcessBuilder(Utils.addTestJavaOpts(xmsValue, xmxValue, - "TimSortStackSize2", "67108864" - ) - ); - OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); + OutputAnalyzer output = ProcessTools.executeTestJava(xmsValue, + xmxValue, + "TimSortStackSize2", + "67108864"); System.out.println(output.getOutput()); output.shouldHaveExitValue(0); - } catch( Exception e ){ + } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); }