[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


please review the following patch:


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.


More information about the hotspot-compiler-dev mailing list