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.

Thread profiling

Goals of thread profiling

Thread profiling provides insights into the behavior and interactions of threads in a .NET application, helping to identify concurrency issues that may impact performance. By periodically recording thread states and call stacks, it enables analysis of state distribution, detection of bottlenecks or deadlocks, estimation of CPU usage, and identification of frozen threads. This low-overhead process offers valuable information for optimizing thread interactions and resource utilization without significantly affecting application performance.

Thread profiling modes

States and stacks mode

Periodically record states and stacks of running threads. This information makes it possible to build a timeline of thread states, as well as to estimate CPU usage and enables frozen thread detection.

Retrieving thread states and stacks incurs low overhead, primarily because these operations are conducted infrequently. This overhead is significantly lower when compared to CPU profiling.

States mode

Periodically record only the states of running threads. Thread stacks are not recorded and the CPU usage estimation will be unavailable, but profiling overhead will be lower.

Controlling thread profiling

Profiler UI

When the profiler is connected to the profiled application, the toolbar contains the following exception profiling controls:

Toolbar Button Description
Start thread profiling button Stop thread profiling button Start/Stop thread profiling.
Clear thread profiling results button Clear thread profiling results.

When thread profiling is started, previous results are cleared automatically.

Agent startup options

Thread profiling collects states and stacks by default. Interval for collecting this data is set to 1 second and limited to 1 hour. However, this can be adjusted with startup options threads, telemetry_period, telemetry_limit.

HTTP API

For users requiring remote control or automation within their profiling workflows, YourKit .NET Profiler offers control over the thread profiling through HTTP API endpoints. The documentation outlines startThreadProfiling, stopThreadProfiling and resetThreadProfiling methods available for this purpose.

.NET API

The YourKit .NET Profiler also provides a .NET API for deep integration with .NET applications. The YourKit.Profiler.Api.Controller includes methods for starting, stopping, and resetting the thread profiling, similar to the toolbar buttons.

Threads tab

Thread profiling tab offers a suite of tools to analyze thread behavior, providing insights into performance and concurrency issues. These views help in understanding thread interactions:

  • Telemetry charts showing thread-related performance metrics over time.
  • Thread states timeline of thread state transitions, such as running, waiting, and more.
  • Frozen threads helps identify threads that are unresponsive or stuck.

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.