8190679: java/util/Arrays/TimSortStackSize2.java fails with "Initial heap size set to a larger value than the maximum heap size"

Reviewed-by: dholmes
This commit is contained in:
Igor Ignatyev 2018-02-27 21:29:08 -08:00
parent d2ce0ae7d4
commit d078a3f091

View File

@ -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 @@ public class TimSortStackSize2 {
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"
)
);