- 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
JFR (Java Flight Recorder) snapshots
Java Flight Recorder (JFR) is a robust profiling tool built into the Oracle JDK and OpenJDK starting from version 11. It provides a low-overhead way to gather detailed performance metrics and statistics from your Java applications.
Integrating Java Flight Recorder with YourKit Java Profiler can provide you with an unparalleled toolset for diagnosing and fixing performance bottlenecks in your Java applications. The low overhead of JFR combined with the unique features and powerful analytics capabilities of YourKit offer a robust solution for both developers and performance engineers.
How to capture JFR snapshot
Start recording using startup JVM options:
java -XX:StartFlightRecording ...
Start recording on an already running JVM:
jcmd <pid> JFR.start
Recording data can be dumped to a file using the JFR dump command:
jcmd <pid> JFR.dump filename=recording.jfr
Analyzing JFR snapshot
YourKit Java Profiler supports JFR snapshots (the files
with .jfr
extension), and they can be opened
and analyzed just like native YourKit Java Profiler snapshots.
Depending on the data contained in the JFR file, the following views are available:
-
CPU tab:
- CPU usage and thread count graphs;
-
Profiling results are presented as call trees, method list, hot spots, flame graph basing on recorded
jdk.ExecutionSample
("Method profiling sample") events.JFR obtains them by sampling.
-
Threads tab:
All recorded events are shown in a graphical timeline.
-
Memory tab:
-
The "Memory & GC Telemetry" section shows graphs for:
- heap and non-heap memory usage;
- loaded class count;
- garbage collector statistics (pauses and collection counts);
- object allocation rate (based on recorded allocation events - see below).
-
The "Allocations" section shows object allocation profiling results
basing on recorded allocation events which are
jdk.ObjectAllocationInNewTLAB
("Allocation in new TLAB") andjdk.ObjectAllocationOutsideTLAB
("Allocation outside TLAB") for JDK 15 and older, andjdk.ObjectAllocationSample
("Object Allocation Sample") since JDK 16.
-
The "Memory & GC Telemetry" section shows graphs for:
-
"Monitors" tab:
Blocked and waiting monitor statistics is shown basing on recorded
jdk.JavaMonitorEnter
("Java Monitor Blocked") andjdk.JavaMonitorWait
("Java Monitor Wait") events. -
"Exceptions" tab:
Thrown exception statistics basing on recorded
jdk.JavaExceptionThrow
("Java Exception") andjdk.JavaErrorThrow
("Java Error") events. -
"Telemetry" tab:
Shows all telemetry graphs in the same place one above the other, with their time axis synchronized.
In graphs, the CPU usage estimation feature is available basing on recorded
jdk.ExecutionSample
("Method profiling sample") events. The same event is used for CPU profiling results. -
"Events" tab:
This tab presents all recorded events uniformly in a table form, while each other top level tab offers a specialized presentation of particular event types.
-
"Summary" tab:
Profiled process detail and profiling result summary. Also, automatic deobfuscation for an obfuscated profiled code can be configured in this tab.