8129590: TestShrinkDefragmentedHeap.java runs out of memory
authorsjohanss
Wed, 01 Jul 2015 16:38:14 +0200
changeset 31622 65674ad91414
parent 31621 cad769d519ee
child 31623 5b83e0eb7073
child 31624 a184abca1684
8129590: TestShrinkDefragmentedHeap.java runs out of memory Reviewed-by: jwilhelm, tschatzl
hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java
--- a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java	Wed Jul 01 10:26:59 2015 +0000
+++ b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java	Wed Jul 01 16:38:14 2015 +0200
@@ -23,7 +23,7 @@
 
 /**
  * @test TestShrinkDefragmentedHeap
- * @bug 8038423
+ * @bug 8038423 8129590
  * @summary Verify that heap shrinks after GC in the presence of fragmentation due to humongous objects
  *     1. allocate small objects mixed with humongous ones
  *        "ssssHssssHssssHssssHssssHssssHssssH"
@@ -51,12 +51,14 @@
     // To avoid this the Eden needs to be big enough to fit all the small objects.
     private static final int INITIAL_HEAP_SIZE  = 200 * 1024 * 1024;
     private static final int MINIMAL_YOUNG_SIZE = 190 * 1024 * 1024;
+    private static final int MAXIMUM_HEAP_SIZE  = 256 * 1024 * 1024;
     private static final int REGION_SIZE        = 1 * 1024 * 1024;
 
     public static void main(String[] args) throws Exception, Throwable {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
                 "-XX:InitialHeapSize=" + INITIAL_HEAP_SIZE,
                 "-Xmn" + MINIMAL_YOUNG_SIZE,
+                "-Xmx" + MAXIMUM_HEAP_SIZE,
                 "-XX:MinHeapFreeRatio=10",
                 "-XX:MaxHeapFreeRatio=11",
                 "-XX:+UseG1GC",