8153277: [TESTBUG] gc/arguments/TestMaxMinHeapFreeRatioFlags is too sensitive for stray allocations in verifyRatio
Reviewed-by: mgerdin, dfazunen
--- 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) {