Java Flight Recorder (JFR) is a tool for helping debug many kinds of performance issues. JFR captures a large set of JVM performance information into a flight recording file. The recording can then be analyzed offline using Java Mission Control.
Note: JFR is not available on IBM JREs. Please see - How to generate a YourKit session if using an IBM JRE.
OpenJDK 8u262 and 11+
JFR is available in OpenJDK 11+. Additionally, it was back-ported to OpenJDK 8u262, so all recent OpenJDK 1.8 distributions should have JFR available.
We normally ask that you capture a profiling recording via modifying the settings property to settings=profile
.
WARN
or ERROR
when capturing the profiling recording. See agent.logger
configuration at - Java Configuration for further details.settings=profile
captures may vary from Java release to release. The following are a few example configurations for starting a JFR:
# Record to file "recording.jfr", use the settings "profile" -XX:StartFlightRecording=filename=recording.jfr,settings=profile
# Record to file "recording.jfr", record for 5mins before dumping results, use the settings "profile" -XX:StartFlightRecording=filename=recording.jfr,duration=300s,settings=profile
# Record to file "recording.jfr", delay starting recording for 30s, use the settings "profile" -XX:StartFlightRecording=filename=recording.jfr,delay=30s,settings=profile
Recording to disk manually using jcmd
The following example recording to disk and using jcmd requires a JDK install and access to the server/container running the application. For example:
-XX:StartFlightRecording=disk=true,name=recording-1,filename=/tmp/agent.jfr,maxage=15m,dumponexit=true,settings=profile
Then, log in to the application server and run jcmd
to find the process ID.
Then, run jcmd <PID> JFR.dump filename=/recording.jfr
to record the data.
See also: