I need to do some experiments showing the effect of inlining on my code. Anybody knows how to disable inlining with sun jvm? I searched http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html and got to know -XX:InlineSmallCode=n can control the threshold of the inlining candidates. So will -xx:InlineSmallCode=0 work?
I would try -XX:MaxInlineSize=0
instead. The description for InlineSmallCode
seems a bit unclear as to whether or not it applies to all inlinings. You might also find this blog post helpful as it explains how to tell the JIT compiler to print information about which methods are being inlined:
Java 7: How to write really fast Java code
I think there might still be one exception where you can't disable inlining, and that's for completely empty methods (since the inlined method size would still be 0).
In Java 8, you can do it by passing the option -XX:-Inline
to the JVM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With