- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Object allocation profiling
- Memory profiling
- Exception profiling
- Telemetry
- Probes: monitor higher level events
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary, automatic deobfuscation
- Filters
- Profiler command line
- Command line tool to control profiling
- Export of profiling results to external formats
- Profiler .NET API
- Profiler HTTP API
- Settings
- Troubleshooting
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/Stop thread profiling. |
![]() |
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.