- System requirements
- Profiler architecture
- Running the profiler
- Profiler activation
- Running applications with the profiler
- Connect to profiled application
- Troubleshoot connection problems
- Solving performance problems
- CPU profiling
- Deadlock detector
- Memory profiling
- Memory telemetry
- Memory snapshot
- Object allocation recording
- Shallow and retained sizes
- Memory views
- Memory inspections
- Comparing memory snapshots
- Support of HPROF format snapshots
- Support of Java Flight Recorder (JFR)
- Support of Portable Heap Dumps (.phd)
- Values of primitive types
- Persistent object IDs
- Useful actions
- Set description language
- Garbage collection
- Monitor profiling
- Exception profiling
- Probes: monitor events of various kinds
- Performance Charts
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Summary, snapshot annotation, automatic deobfuscation
- IDE integration
- Time measurement (CPU time, wall time)
- Snapshot directory customization
- Export of profiling results to HTML, CSV, XML, plain text
- Profiler Java API
- Profiler HTTP API
- Command line tool to control profiling
- FAQ: How to profile in my scenario?
Support of Java Flight Recorder (JFR)
Java Flight Recorder (JFR) files (.jfr) can be opened in YourKit Java Profiler.
You can analyze JFR recordings by using the powerful features that the profiler provides for its own performance snapshots.
What is shown
Depending on the data contained in the JFR file, the following views are available:
- CPU usage and thread count graphs;
Profiling results are presented as call trees, method list, hotspots, flame graph basing on recorded
jdk.ExecutionSample("Method profiling sample") events.
JFR obtains them by sampling.
Note: the same events are used for CPU usage estimation.
All recorded events are shown in a graphical timeline.
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") and
jdk.ObjectAllocationOutsideTLAB("Allocation outside TLAB") for JDK 15 and older, and
jdk.ObjectAllocationSample("Object Allocation Sample") since JDK 16.
- The "Memory & GC Telemetry" section shows graphs for:
"Monitor usage" tab:
Blocked and waiting monitor statistics is shown basing on recorded
jdk.JavaMonitorEnter("Java Monitor Blocked") and
jdk.JavaMonitorWait("Java Monitor Wait") events.
Thrown exception statistics basing on recorded
jdk.JavaExceptionThrow("Java Exception") and
jdk.JavaErrorThrow("Java Error") events.
"Performance Charts" tab:
Shows all telemetry graphs in the same place one above the other, with their time axis synchronized.
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.
Profiled process detail and profiling result summary. Also, automatic deobfuscation for an obfuscated profiled code can be configured in this tab.
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.
Supported recording file formats
The profiler is able to open any valid
.jfr file supported by Java JFR API.
This includes files created by the Flight Recorder itself as well as files produced by other tools
generating output in this format.
Technically, supported versions are 1.x and 2.x. This includes the majority of use cases.
An attempt to open an unsupported file version results in the error:
"File version 0.9. Only Flight Recorder files of version 1.x and 2.x can be read by this JDK."
There are a few known cases when an unsupported version file is produced:
Java Flight Recorder of Oracle JDK Java 8 produces recording files of version 0.9. The JFR is a commercial feature in this JDK and requires the Java option
As a workaround, use OpenJDK Java 8 which produces compatible recording files.
Alternatively, use Java 11 or newer. Any OpenJDK or Oracle JDK produce compatible recording files.
Older versions of Async Profiler ("async-profiler") produce
.jfrfiles of version 0.9. To solve the problem, upgrade to Async Profiler 2.0 or newer.