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.

Asynchronous sampling

Asynchronous sampling is an experimental CPU profiling mode, which provides much better accuracy of collected stack traces than classic sampling. Asynchronous sampling uses an experimental HotSpot API and system CPU timers. This mode available only on a limited number of platforms.

Unlike classic synchronous sampling which periodically queries stacks of all application threads, asynchronous sampling works different. Profiler sets a timer which counts down against the both user and system CPU time consumed by all threads in the process. As soon as a counter exceeds pre-defined CPU time threshold profiler collects call stack in a thread which caused timer expiration.

Due to nature of CPU timers, wall time cannot be measured and methods like sleep() and wait() which don't consume CPU time will not be shown in the results. Time measurement accuracy is high for methods consuming the CPU time the most.

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

System requirements

  • HotSpot JVM.
  • Operating system: macOS, Linux x86, Linux x64.

Overhead

Asynchronous sampling overhead is lower than in other sampling modes and lower than overhead of tracing. However, the probes for the high-level statistics, if enabled, may impose additional overhead.

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

Sampling settings

To configure CPU time threshold use cpu_threshold_ms CPU sampling property.

Asynchronous sampling will be disabled if the startup option disable_async_sampling or disableall is specified.