![]() Previous |
![]() Next |
The default recording for a JVM is like the black box on a plane. It is started when the JVM is launched, runs continuously, and it can be used to analyze crashes, failures, and other events. To enable the default recording, start you Java application with the -XX:FlightRecorderOptions
option set to defaultrecording=true
. Do not forget to unlock commercial features and enable JFR.
For example, to enable the default recording for a Java application named MyApp
, use the following command:
java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true MyApp
To dump the default recording, right-click the Flight Recorder node under the corresponding connection in the JVM Browser and select Dump Default Recording. You can also right-click the recording named HotSpot Default and select Dump. The rest of the procedure is the same as dumping any running recording (see Dumping a Running Flight Recording).