8153277: [TESTBUG] gc/arguments/TestMaxMinHeapFreeRatioFlags is too sensitive for stray allocations in verifyRatio
authorshade
Wed, 06 Apr 2016 10:50:19 +0300
changeset 37412 d5f8d53af5ec
parent 37265 ff874750de46
child 37413 2f71679d06dd
child 37415 35df58edb348
8153277: [TESTBUG] gc/arguments/TestMaxMinHeapFreeRatioFlags is too sensitive for stray allocations in verifyRatio Reviewed-by: mgerdin, dfazunen
hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java
--- a/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Tue Apr 05 23:59:12 2016 +0000
+++ b/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Wed Apr 06 10:50:19 2016 +0300
@@ -168,6 +168,11 @@
             long maxHeapSize = getMax();
             int gcTries = (shrinkHeapInSteps ? GC_TRIES : 1);
 
+            // Initial checks. This also links up everything in these helper methods,
+            // in case it brings more garbage.
+            forceGC(gcTries);
+            verifyRatio(minRatio, maxRatio);
+
             // commit 0.5 of total heap size to have enough space
             // to both shink and expand
             while (getCommitted() < maxHeapSize / 2) {
@@ -215,7 +220,6 @@
             if (previouslyCommitted <= getCommitted()) {
                 throw new RuntimeException("Heap was not shrinked.");
             }
-
         }
 
         public static void forceGC(int gcTries) {