- 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
- Virtual threads support
- Object allocation profiling
- Memory profiling
- Monitor profiling
- Exception profiling
- Telemetry
- Probes: monitor events of various kinds
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary
- Filters
- Profiler command line
- Export of profiling results to external formats
- Profiler Java API
- Profiler HTTP API
- Settings
- Troubleshooting and FAQ
Snapshots
- What is a snapshot?
- Capturing the snapshots
- Snapshot directory customization
- Annotating the snapshots
- Comparing the snapshots
- YourKit Java Profiler is a snapshot polyglot
What is a snapshot?
When you profile your Java 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 Java 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 Java 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 Java 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
,periodic_hprof
- On high-memory usage using triggers.
- Using Profiler HTTP API.
- Using Profiler Java API.
Snapshot directory customization
YourKit Java 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.
YourKit Java Profiler is a snapshot polyglot
The profiler is able to load and analyze snapshots from many popular profiling tools, including HPROF, Java Flight Recorder, and IBM Portable Heap Dumps.