HotSpot compilation latency

Tobias Hartmann tobias.hartmann at oracle.com
Mon Aug 12 11:59:57 UTC 2019


Hi Stefan,

On 12.08.19 13:50, Stefan Reich wrote:
> How quickly does HotSpot start (and finish) to compile methods? Is this
> dependent on the system's speed or on wall time?

A method is JIT compiled once the number of invocations or backedges (for loops) reaches the
corresponding invocation threshold.

With TieredCompilation there are different thresholds for the different tiers:
http://hg.openjdk.java.net/jdk/jdk/file/0211b062843d/src/hotspot/share/runtime/globals.hpp#l1975

See also slide 17 and 36 of:
http://cr.openjdk.java.net/~thartmann/talks/2017-Hotspot_Under_The_Hood.pdf

> So, if I execute, say, a loop that runs for one second, is there a chance
> it will be compiled and on-stack-replaced with an optimized version within
> that second?

That depends on how often the loop backedge is taken on your system in that second.

Best regards,
Tobias


More information about the hotspot-dev mailing list