8157956: OverflowCodeCacheTest.java fails with Out of space in CodeCache for method handle intrinsic
Reviewed-by: kvn
--- a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java Wed Aug 31 12:10:40 2016 -0700
+++ b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java Thu Sep 01 21:12:07 2016 +0300
@@ -75,6 +75,7 @@
System.out.printf("type %s%n", type);
System.out.println("allocating till possible...");
ArrayList<Long> blobs = new ArrayList<>();
+ int compilationActivityMode = -1;
try {
long addr;
int size = (int) (getHeapSize() >> 7);
@@ -88,13 +89,16 @@
type + " doesn't allow using " + actualType + " when overflow");
}
}
- Asserts.assertNotEquals(WHITE_BOX.getCompilationActivityMode(), 1 /* run_compilation*/,
- "Compilation must be disabled when CodeCache(CodeHeap) overflows");
+ /* now, remember compilationActivityMode to check it later, after freeing, since we
+ possibly have no free cache for futher work */
+ compilationActivityMode = WHITE_BOX.getCompilationActivityMode();
} finally {
for (Long blob : blobs) {
WHITE_BOX.freeCodeBlob(blob);
}
}
+ Asserts.assertNotEquals(compilationActivityMode, 1 /* run_compilation*/,
+ "Compilation must be disabled when CodeCache(CodeHeap) overflows");
}
private long getHeapSize() {