--- old/test/gc/TestSmallHeap.java Wed Jul 20 20:46:28 2016 +++ new/test/gc/TestSmallHeap.java Wed Jul 20 20:46:28 2016 @@ -79,9 +79,10 @@ } private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception { + long minMaxHeap = 4 * 1024 * 1024; LinkedList vmOptions = new LinkedList<>(); vmOptions.add(gc); - vmOptions.add("-Xmx2m"); + vmOptions.add("-Xmx" + minMaxHeap); vmOptions.add("-XX:+PrintFlagsFinal"); vmOptions.add(VerifyHeapSize.class.getName()); @@ -89,6 +90,7 @@ OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); analyzer.shouldHaveExitValue(0); + expectedMaxHeap = Math.max(expectedMaxHeap, minMaxHeap); long maxHeapSize = Long.parseLong(analyzer.firstMatch("MaxHeapSize.+=\\s+(\\d+)",1)); long actualHeapSize = Long.parseLong(analyzer.firstMatch(VerifyHeapSize.actualMsg + "(\\d+)",1)); Asserts.assertEQ(maxHeapSize, expectedMaxHeap); --- old/test/gc/arguments/TestMaxHeapSizeTools.java Wed Jul 20 20:46:29 2016 +++ new/test/gc/arguments/TestMaxHeapSizeTools.java Wed Jul 20 20:46:29 2016 @@ -106,7 +106,6 @@ } public static void checkGenMaxHeapErgo(String gcflag) throws Exception { - TestMaxHeapSizeTools.checkGenMaxHeapSize(gcflag, 3); TestMaxHeapSizeTools.checkGenMaxHeapSize(gcflag, 4); TestMaxHeapSizeTools.checkGenMaxHeapSize(gcflag, 5); } @@ -132,7 +131,6 @@ } private static void checkValidInitialMaxHeapCombinations(String gcflag) throws Exception { - expectValid(new String[] { gcflag, "-XX:MaxHeapSize=2048K", "-version" }); expectValid(new String[] { gcflag, "-XX:InitialHeapSize=4M", "-XX:MaxHeapSize=8M", "-version" }); expectValid(new String[] { gcflag, "-XX:MaxHeapSize=8M", "-XX:InitialHeapSize=4M", "-version" }); expectValid(new String[] { gcflag, "-XX:MaxHeapSize=4M", "-XX:InitialHeapSize=4M", "-version" });