- 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
Snapshots
- What is a snapshot?
- Capturing the snapshots
- Snapshot directory customization
- Annotating the snapshots
- Comparing the snapshots
What is a snapshot?
When you profile your .NET application, the profiler collects various performance metrics, which need to be saved at a specific moment for further analysis. A snapshot is essentially a saved state of various performance metrics and data collected from a running .NET application at a specific point in time.
Typically, the snapshots come in two main types: memory snapshots and performance snapshots. Performance snapshots are usually small. They contain data about CPU usage, database queries, and other performance metrics. Memory snapshots (snapshots with .NET heap) contain everything that performance snapshots contain, and in addition, they also include a graph of all objects and the relationships between them. The size of a memory snapshot is usually comparable to the memory footprint of the profiled .NET application.
Capturing the snapshots
Monitoring in real-time is often the first step in diagnosing
performance bottlenecks or inefficiencies.
However, the most powerful option is the ability to
capture performance or memory snapshots for in-depth analysis.
The snapshot files have extension .snapshot
and
are created in the snapshot directory.
There are many ways to capture snapshots:
-
You can easily capture snapshots with the click of
or
buttons in the profiler toolbar.
-
Using startup options:
on_exit
,used_mem
,periodic_perf
,periodic_mem
- On high-memory usage using triggers.
- Using Profiler HTTP API.
- Using Profiler .NET API.
Snapshot directory customization
YourKit .NET Profiler allows you to configure the directory in which snapshots are saved.
Annotating the snapshots
You can annotate or add comments to the snapshots. Snapshot annotations offer a valuable way to enrich your snapshots with meaningful context. They enable better collaboration, provide additional information, and even serve as inline documentation.
Comparing the snapshots
Comparing performance snapshots and comparing memory snapshots is an invaluable technique in the performance tuning process. By systematically capturing and comparing key metrics before and after changes, you can scientifically measure the impact of your optimizations, thereby turning the often murky waters of performance tuning into a more clear-cut, data-driven activity.