test/gc/arguments/TestMaxHeapSizeTools.java

Print this page

        

@@ -248,10 +248,16 @@
     getMinInitialMaxHeap(new String[] { gcflag, "-XX:MaxHeapSize=" + maxHeapsize + "M" }, v);
 
     long expectedHeapSize = align_up(maxHeapsize * K * K, v.maxAlignment);
     long actualHeapSize = v.maxHeapSize;
 
+    // bug 8027915 & 8027960: compensate for some cases of large pages
+    if (gcflag.equals("-XX:+UseParallelOldGC")) {
+        int numberOfSpaces = 4;
+        expectedHeapSize = Math.max(expectedHeapSize, numberOfSpaces * v.minAlignment);
+    }
+
     if (actualHeapSize > expectedHeapSize) {
       throw new RuntimeException("Heap has " + actualHeapSize  +
         " bytes, expected to be less than " + expectedHeapSize);
     }
   }