How to disable overlay optimization using sun jvm?

I need to do some experiments showing the effect of embedding code. Does anyone know how to disable inlining with sun jvm? I searched http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html and met -XX: InlineSmallCode = n can control the threshold of candidates for inlining. So will -xx: InlineSmallCode = 0 work?

+6
source share
1 answer

I would try -XX:MaxInlineSize=0 . The description for InlineSmallCode seems a bit unclear as to whether it applies to all inlins or not. You may also find this blog post useful, as it explains how to tell the JIT compiler to print information about which methods are inserted:

Java 7: How to Write Really Fast Java Code

I think there can still be one exception where you cannot disable inlining, and that for completely empty methods (since the size of the inline method will be 0).

+5
source

All Articles