Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Call counting

Call counting is one of the lightweight CPU profiling modes.

Unlike other modes only method invocations are counted, neither call stacks nor times are gathered. Use this mode to initially detect possible problems: thanks to its low overhead you may do this even in production.

It's a simple tool for identifying potential performance problems caused by suboptimal algorithms. The approach is based on assumption that methods with a big number of invocations may indicate a performance problem.

Further investigation may involve using CPU tracing or sampling to get comprehensive profiling results including times and stack traces (call tree).

Use profiler toolbar to start call counting as shown on the picture below. There are also alternate methods to start CPU profiling.

Overhead

Call counting is specially designed to have minimal possible, almost zero overhead:

  • It provides a plain method list with method invocation counts. Unlike other CPU profiling modes it does not provide stack traces nor method times.
  • Method invocations from different threads are summed and cannot be distinguished.
  • Counts are not guaranteed to be exact. To ensure minimal overhead invocation counts are updated without taking any locks or using test-and-set style atomic operations. If the same method is simultaneously called in different threads running in parallel on different CPU cores, some of its invocations may be missed by a non-atomic counter. Fortunately, the probability of such events is low, and missed invocations, if any, will normally constitute only a small fraction of all invocations.
  • The probes in Auto activity mode are not activated in call counting, thus high-level statistics is not collected.

See also: Profiling overhead: how to reduce or avoid.

Call counting settings

Call counting will be disabled if the startup option disabletracing or disableall is specified.