Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy-to-use performance and memory .NET profiler for Windows, Linux and macOS.
Secure and easy profiling in cloud, containers and clustered environments.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

CPU profiling modes

YourKit Java Profiler provides a variety of CPU profiling modes to cater to different performance analysis requirements. Choosing the right profiling mode depends on your specific needs and the trade-offs you are willing to make between detail level, performance overhead, and analysis complexity. Here's an overview of CPU profiling modes, and when you might want to use each:

CPU usage estimation or statistical profiling

Statistical profiling is a specialized form of CPU sampling where the sampling rate is kept deliberately low. Unlike traditional sampling, which aims for higher-frequency stack samples to capture more detail, statistical profiling focuses on long-term behavior by sampling the call stack at infrequent intervals. This allows for a broader view of the application's performance, making it easier to identify long-term trends and aggregate bottlenecks.

Advantages:

  • Extremely low performance overhead
  • Useful for identifying broader performance trends
  • Easy to run in the production environment

Disadvantages:

  • Not suitable for capturing short-lived or rare events
  • Estimations may be less precise due to the low sample rate

Lear more about CPU estimation

CPU sampling

Profiler takes periodic snapshots of a program's call stack at fixed intervals. This approach is less intrusive compared to tracing and typically introduces less overhead. However, the data may not be as detailed, and you may miss short-lived or infrequently called functions.

Advantages:

  • Lower performance overhead
  • Easier data analysis

Disadvantages:

  • Less detailed than tracing
  • May miss short-lived or rare events

Lear more about CPU sampling

Asynchronous CPU sampling

Asynchronous CPU sampling is a more advanced variation of CPU sampling. Instead of relying on fixed time intervals, it adjusts the sampling rate based on some external criteria, such as CPU load or other system metrics. This can provide a more nuanced view of system behavior under different conditions.

Advantages:

  • Adaptive to system state
  • May capture events missed by traditional sampling

Disadvantages:

  • Not supported by all JVMs and operating systems

Lear more about asynchronous CPU sampling

CPU tracing

In this mode, the profiler captures a detailed, chronological trace of all function calls made during the program’s execution. This allows you to get an exact account of which functions were called, how often, and in what sequence. However, CPU tracing can introduce significant overhead, making the application slower during the profiling period. The data obtained is often extensive, requiring a lot of effort to analyze.

Advantages:

  • High detail level
  • Complete chronological history

Disadvantages:

  • Significant performance overhead

Lear more about CPU tracing

Call counting

Call counting mode involves instrumenting the code to keep a counter for each function call. Every time a particular function is called, the counter increments by one. This provides an exact count of how often each function is invoked but doesn't provide information about the time spent within those functions or their sequence.

Advantages:

  • Accurate count of function calls
  • Minimal possible performance overhead

Disadvantages:

  • No timing information
  • No stack traces

Lear more about call counting

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.