changeset 10816:f93500768dca

8153277: [TESTBUG] gc/arguments/TestMaxMinHeapFreeRatioFlags is too sensitive for stray allocations in verifyRatio Reviewed-by: mgerdin, dfazunen
author shade
date Wed, 06 Apr 2016 10:50:19 +0300
parents f6aed2e19cae
children 883cb1b6b204 20b4d892988e
files test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Tue Apr 05 23:59:12 2016 +0000
+++ b/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) {