# HG changeset patch # User iignatyev # Date 1519795748 28800 # Node ID 1836bf0c820ac6a66d251025fb591e395d527f3c # Parent eebf559c9e0dc8ab7c995c5985851ee2f819c911 8190679: java/util/Arrays/TimSortStackSize2.java fails with "Initial heap size set to a larger value than the maximum heap size" Reviewed-by: dholmes diff -r eebf559c9e0d -r 1836bf0c820a test/jdk/java/util/Arrays/TimSortStackSize2.java --- a/test/jdk/java/util/Arrays/TimSortStackSize2.java Tue Feb 27 18:17:57 2018 -0500 +++ b/test/jdk/java/util/Arrays/TimSortStackSize2.java Tue Feb 27 21:29:08 2018 -0800 @@ -29,7 +29,8 @@ * java.base/jdk.internal * @build jdk.testlibrary.* * @build TimSortStackSize2 - * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI TimSortStackSize2 * @summary Test TimSort stack size on big arrays @@ -63,13 +64,14 @@ try { Boolean compressedOops = WhiteBox.getWhiteBox() .getBooleanVMFlag("UseCompressedOops"); - final String xmsValue = "-Xms" + - ((compressedOops == null || compressedOops) ? "385" : "770") - + "m"; - System.out.println( "compressedOops: " + compressedOops - + "; Test will be started with \"" + xmsValue + "\""); + long memory = (compressedOops == null || compressedOops) ? 385 : 770; + final String xmsValue = "-Xms" + memory + "m"; + final String xmxValue = "-Xmx" + 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, + .createJavaProcessBuilder(Utils.addTestJavaOpts(xmsValue, xmxValue, "TimSortStackSize2", "67108864" ) );