diff -r 29b91dd20de6 test/compiler/codecache/stress/CodeCacheStressRunner.java --- a/test/compiler/codecache/stress/CodeCacheStressRunner.java Tue Feb 24 17:14:29 2015 +0000 +++ b/test/compiler/codecache/stress/CodeCacheStressRunner.java Wed Feb 25 16:36:23 2015 +0300 @@ -26,6 +26,8 @@ import com.oracle.java.testlibrary.Utils; public class CodeCacheStressRunner { + private Runtime runtime = Runtime.getRuntime(); + private long maxUsage; private final Runnable action; public CodeCacheStressRunner(Runnable action) { this.action = action; @@ -44,9 +46,23 @@ } private boolean test() { - Helper.TestCase obj = Helper.TestCase.get(); - Helper.callMethod(obj.getCallable(), obj.expectedValue()); + if (free() > maxUsage * 1.5) { + long before = used(); + Helper.TestCase obj = Helper.TestCase.get(); + Helper.callMethod(obj.getCallable(), obj.expectedValue()); + long after = used(); + long usage = after > before ? after - before : 0; + maxUsage = Math.max(usage, maxUsage); + } return true; } + private long free() { + return runtime.freeMemory(); + } + + private long used() { + return runtime.totalMemory() - free(); + } + } diff -r 29b91dd20de6 test/compiler/codecache/stress/OverloadCompileQueueTest.java --- a/test/compiler/codecache/stress/OverloadCompileQueueTest.java Tue Feb 24 17:14:29 2015 +0000 +++ b/test/compiler/codecache/stress/OverloadCompileQueueTest.java Wed Feb 25 16:36:23 2015 +0300 @@ -30,7 +30,6 @@ /* * @test OverloadCompileQueueTest * @library /testlibrary /../../test/lib - * @ignore 8071905 * @build OverloadCompileQueueTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission