I am going through the JIT HotSpot compiler logs (-XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
) to make sure an important/hot method is being optimized/compiled. The method shows:
already compiled into a big method
What does that mean? Is my method being correctly optimized/inlined by JIT?
This explanation from the Oracle wiki did not take me to any conclusion:
already compiled into a big method: there is already compiled code for the method that is called from the call site and the code that was generated for is larger than InlineSmallCode
What does that mean? Does it mean my code was optimized/inlined or the HotSpot is now skipping it because it is compiled somewhere else?
Looking at hotspot source (search for "already compiled into a big method") it is clear that the message appears if a candidate method for inlining is already compiled into native code and the native code size exceeds the threshold InlineSmallCode (which is platform dependent and can be set via -XX:InlineSmallCode=n). Therefore this message does not depend on the caller.
How can it be - as you commented - that a method a() is sometimes inlined and sometimes not (with message "already compiled into a big method")?
One possible explanation is that a() calls another method b() and the optimization runs as follows:
Maybe you can check this theory given your inline logs.
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