[9] RFR(S): 8148751: [TESTBUG] compiler/whitebox/AllocationCodeBlobTest.java fails due to unexpected code cache allocation

Tobias Hartmann tobias.hartmann at oracle.com
Wed Feb 3 11:26:18 UTC 2016


Hi,

please review the following patch:

https://bugs.openjdk.java.net/browse/JDK-8148751
http://cr.openjdk.java.net/~thartmann/8148751/webrev.00/

The test fails with "free shouldn't increase memory usage" because it doesn't expect the code cache usage to increase after a WhiteBox.freeCodeBlob(). The problem is that although the test disables compilation with "-XX:CompileCommand=compileonly,null::*", resolving of invokedynamic instructions may still trigger creation of method handle intrinsics in the code cache and therefore increase the code cache usage. In this case, the call to Asserts.assertLTE() immediately after the usage measurement triggers compilation:

538 33 n 0 java.lang.invoke.MethodHandle::linkToStatic(JJL)L (native) (static) 
539 34 n 0 java.lang.invoke.MethodHandle::invokeBasic(JJ)L (native) 
539 35 n 0 java.lang.invoke.MethodHandle::linkToSpecial(LJJL)L (native) (static)

The fix is to first do all the measurements and then check the results. Like this, we avoid interference in-between the measurements.

Thanks,
Tobias


More information about the hotspot-compiler-dev mailing list