This appendix serves as a basic reference to the commands you can use with the Java Flight Recorder. It contains these sections:
When you launch your Java application with the java
command, you can specify options to enable Java Flight Recorder, configure its settings, and start a recording. The following command-line options are specific to Java Flight Recorder:
-XX:+|-FlightRecorder
-XX:FlightRecorderOptions
-XX:StartFlightRecording
These command-line options are available only in the commercial license of the JDK. To use them, you have to also specify the -XX:+UnlickCommercialFeatures
option.
For more information about these options, see Java Command Line Reference at http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html
(Solaris, Linux)
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
(Windows)
Note: You should use |
This is a description of the Diagnostic Commands available to control Java Flight Recorder and the parameters available for each command. This information is also available by typing jcmd <
pid
> help <
command
>
. The diagnostic commands associated with Java Flight Recorder are:
For more information about using the jcmd
command, see the jcmd
documentation at:
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jcmd.html
The JFR.start
diagnostic command starts a flight recording. Table A-1 lists the parameters you can use with this command.
Table A-1 JFR.start
Parameter | Description | Type of value | Default |
---|---|---|---|
name |
Name of recording |
String |
|
settings |
Server-side template |
String |
|
defaultrecording |
Starts default recording |
Boolean |
False |
delay |
Delay start of recording |
Time |
0s |
duration |
Duration of recording |
Time |
0s (means "forever") |
filename |
Resulting recording filename |
String |
|
compress |
GZip compress the resulting recording file |
Boolean |
False |
maxage |
Maximum age of buffer data |
Time |
0s (means "no age limit") |
maxsize |
Maximum size of buffers in bytes |
Long |
0 (means "no max size") |
The JFR.check
command shows information about running recordings. Table A-2 lists the parameters you can use with this command.
The JFR.stop
diagnostic command stops running flight recordings. Table A-3 lists the parameters you can use with this command.
The JFR.dump
diagnostic command stops running flight recordings. Table A-4 lists the parameters you can use with this command.