# HG changeset patch # User sjohanss # Date 1435761494 -7200 # Node ID 65674ad914148f10129f2646f20edac55ce5a564 # Parent cad769d519ee9274c03439f9b5cb135ed98ff05a 8129590: TestShrinkDefragmentedHeap.java runs out of memory Reviewed-by: jwilhelm, tschatzl diff -r cad769d519ee -r 65674ad91414 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",