Invocation counters

Invocation counters are an instrumentation mechanism for the detection of hot code. Typically, an invocation counter is implemented as a piece of code, compiled into a method header, that increments a value in memory. Thus, each invocation of the method will lead to the counter being incremented. An adaptive runtime can regularly scan the counters to see if they have reached threshold values, which would qualify the method for reoptimization. Invocation counters are quite a coarse tool for hotspot detection and should probably be combined with some other mechanism, for example thread sampling.

See also Exact profiling and Thread sampling.

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.