Does HotSpot ever stop profiling?

Vitaly Davidovich vitalyd at
Mon Sep 16 22:47:39 UTC 2019

On Mon, Sep 16, 2019 at 6:35 PM Stefan Reich <
stefan.reich.maker.of.eye at> wrote:

> Here's another thing I would love to have cleared up.
> Once a method is C2-compiled - does it still update its invocation
> counters?

Nope.  C2 compiled methods run profile-free.  There can be certain events
that trigger a deopt that will toss out the C2 method (with future C2
compilations off newly collected profiling possible), but it won’t be
counter based.

> I would assume counting stops at that point since we have done all we could
> for the method. Also the invocation counting overhead is always
> embarrassing when fighting some C++ guys over claims on how "slow" Java is.
> :o)
> OTOH, there might be scenarios where it makes sense to have a second look
> at "hot" methods, even if they are C2-compiled. Not sure if that scenario
> exists in the current infrastructure.

That infrastructure is called a process restart :) j/k.  There’re some
compiler control APIs, but they’re mostly to allow JIT testing (AFAIK).  I
think it allows manually marking a C2 method for reclaim (ie not entrant),
but I don’t recall the details offhand.

> Which one is it in reality?
> --
> Stefan Reich
> // Java-based operating systems
Sent from my phone

More information about the hotspot-dev mailing list