|
NAMEjstat - monitor JVM statisticsSYNOPSISNote: This command is experimental and unsupported.jstat generalOptions jstat outputOptions [-t] [-h lines] vmid [interval [count]]
DESCRIPTIONThe jstat command displays performance statistics for an instrumented Java HotSpot VM. The target JVM is identified by its virtual machine identifier, or vmid option.The jstat command supports two types of options, general options and output options. General options cause the jstat command to display simple usage and version information. Output options determine the content and format of the statistical output. All options and their functionality are subject to change or removal in future releases. GENERAL OPTIONSIf you specify one of the general options, then you can't specify any other option or parameter.
OUTPUT OPTIONS FOR THE JSTAT COMMANDIf you don't specify a general option, then you can specify output options. Output options determine the content and format of the jstat command's output, and consist of a single statOption, plus any of the other output options (-h, -t, and -J). The statOption must come first.Output is formatted as a table, with columns that are separated by spaces. A header row with titles describes the columns. Use the -h option to set the frequency at which the header is displayed. Column header names are consistent among the different options. In general, if two options provide a column with the same name, then the data source for the two columns is the same. Use the -t option to display a time-stamp column, labeled Timestamp as the first column of output. The Timestamp column contains the elapsed time, in seconds, since the target JVM started. The resolution of the time stamp is dependent on various factors and is subject to variation due to delayed thread scheduling on heavily loaded systems. Use the interval and count parameters to determine how frequently and how many times, respectively, the jstat command displays its output. Note: Don't write scripts to parse the jstat command's output because the format might change in future releases. If you write scripts that parse the jstat command output, then expect to modify them for future releases of this tool.
class: Displays statistics about the behavior of the class loader. compiler: Displays statistics about the behavior of the Java HotSpot VM Just-in-Time compiler. gc: Displays statistics about the behavior of the garbage collected heap. gccapacity: Displays statistics about the capacities of the generations and their corresponding spaces. gccause: Displays a summary about garbage collection statistics (same as -gcutil), with the cause of the last and current (when applicable) garbage collection events. gcnew: Displays statistics about the behavior of the new generation. gcnewcapacity: Displays statistics about the sizes of the new generations and their corresponding spaces. gcold: Displays statistics about the behavior of the old generation and metaspace statistics. gcoldcapacity: Displays statistics about the sizes of the old generation. gcmetacapacity: Displays statistics about the sizes of the metaspace. gcutil: Displays a summary about garbage collection statistics. printcompilation: Displays Java HotSpot VM compilation method statistics.
STAT OPTIONS AND OUTPUTThe following information summarizes the columns that the jstat command outputs for each statOption.
Loaded: Number of classes loaded. Bytes: Number of KB loaded. Unloaded: Number of classes unloaded. Bytes: Number of KB loaded. Time: Time spent performing class loading and unloading operations.
Compiled: Number of compilation tasks performed. Failed: Number of compilations tasks failed. Invalid: Number of compilation tasks that were invalidated. Time: Time spent performing compilation tasks. FailedType: Compile type of the last failed compilation. FailedMethod: Class name and method of the last failed compilation.
S0C: Current survivor space 0 capacity (KB). S1C: Current survivor space 1 capacity (KB). S0U: Survivor space 0 utilization (KB). S1U: Survivor space 1 utilization (KB). EC: Current eden space capacity (KB). EU: Eden space utilization (KB). OC: Current old space capacity (KB). OU: Old space utilization (KB). MC: Metaspace Committed Size (KB). MU: Metaspace utilization (KB). CCSC: Compressed class committed size (KB). CCSU: Compressed class space used (KB). YGC: Number of young generation garbage collection (GC) events. YGCT: Young generation garbage collection time. FGC: Number of full GC events. FGCT: Full garbage collection time. GCT: Total garbage collection time.
NGCMN: Minimum new generation capacity (KB). NGCMX: Maximum new generation capacity (KB). NGC: Current new generation capacity (KB). S0C: Current survivor space 0 capacity (KB). S1C: Current survivor space 1 capacity (KB). EC: Current eden space capacity (KB). OGCMN: Minimum old generation capacity (KB). OGCMX: Maximum old generation capacity (KB). OGC: Current old generation capacity (KB). OC: Current old space capacity (KB). MCMN: Minimum metaspace capacity (KB). MCMX: Maximum metaspace capacity (KB). MC: Metaspace Committed Size (KB). CCSMN: Compressed class space minimum capacity (KB). CCSMX: Compressed class space maximum capacity (KB). CCSC: Compressed class committed size (KB). YGC: Number of young generation GC events. FGC: Number of full GC events.
LGCC: Cause of last garbage collection GCC: Cause of current garbage collection
S0C: Current survivor space 0 capacity (KB). S1C: Current survivor space 1 capacity (KB). S0U: Survivor space 0 utilization (KB). S1U: Survivor space 1 utilization (KB). TT: Tenuring threshold. MTT: Maximum tenuring threshold. DSS: Desired survivor size (KB). EC: Current eden space capacity (KB). EU: Eden space utilization (KB). YGC: Number of young generation GC events. YGCT: Young generation garbage collection time.
NGCMN: Minimum new generation capacity (KB). NGCMX: Maximum new generation capacity (KB). NGC: Current new generation capacity (KB). S0CMX: Maximum survivor space 0 capacity (KB). S0C: Current survivor space 0 capacity (KB). S1CMX: Maximum survivor space 1 capacity (KB). S1C: Current survivor space 1 capacity (KB). ECMX: Maximum eden space capacity (KB). EC: Current eden space capacity (KB). YGC: Number of young generation GC events. FGC: Number of full GC events.
MC: Metaspace Committed Size (KB). MU: Metaspace utilization (KB). CCSC: Compressed class committed size (KB). CCSU: Compressed class space used (KB). OC: Current old space capacity (KB). OU: Old space utilization (KB). YGC: Number of young generation GC events. FGC: Number of full GC events. FGCT: Full garbage collection time. GCT: Total garbage collection time.
OGCMN: Minimum old generation capacity (KB). OGCMX: Maximum old generation capacity (KB). OGC: Current old generation capacity (KB). OC: Current old space capacity (KB). YGC: Number of young generation GC events. FGC: Number of full GC events. FGCT: Full garbage collection time. GCT: Total garbage collection time.
MCMN: Minimum metaspace capacity (KB). MCMX: Maximum metaspace capacity (KB). MC: Metaspace Committed Size (KB). CCSMN: Compressed class space minimum capacity (KB). CCSMX: Compressed class space maximum capacity (KB). YGC: Number of young generation GC events. FGC: Number of full GC events. FGCT: Full garbage collection time. GCT: Total garbage collection time.
S0: Survivor space 0 utilization as a percentage of the space's current capacity. S1: Survivor space 1 utilization as a percentage of the space's current capacity. E: Eden space utilization as a percentage of the space's current capacity. O: Old space utilization as a percentage of the space's current capacity. M: Metaspace utilization as a percentage of the space's current capacity. CCS: Compressed class space utilization as a percentage. YGC: Number of young generation GC events. YGCT: Young generation garbage collection time. FGC: Number of full GC events. FGCT: Full garbage collection time. GCT: Total garbage collection time.
Compiled: Number of compilation tasks performed by the most recently compiled method. Size: Number of bytes of byte code of the most recently compiled method. Type: Compilation type of the most recently compiled method. Method: Class name and method name identifying the most recently compiled method. Class name uses a slash (/) instead of a dot (.) as a name space separator. The method name is the method within the specified class. The format for these two fields is consistent with the HotSpot -XX:+PrintCompilation option. VIRTUAL MACHINE IDENTIFIERThe syntax of the vmid string corresponds to the syntax of a URI:[protocol:][//]lvmid[@hostname[:port][/servername] The syntax of the vmid string corresponds to the syntax of a URI. The vmid string can vary from a simple integer that represents a local JVM to a more complex construction that specifies a communications protocol, port number, and other implementation-specific values.
Note: JDK 10 has added support for using the Attach API when attaching to Java processes running in a separate docker process. However, the jps command will not list the JVM processes that are running in a separate docker instance. If you are trying to connect a Linux host with a Virtual Machine that is in a docker container, you must use tools such as ps to look up the PID of the JVM.
EXAMPLESThis section presents some examples of monitoring a local JVM with an lvmid of 21891.THE GCUTIL OPTIONThis example attaches to lvmid 21891 and takes 7 samples at 250 millisecond intervals and displays the output as specified by the -gcutil option.The output of this example shows that a young generation collection occurred between the third and fourth sample. The collection took 0.078 seconds and promoted objects from the eden space (E) to the old space (O), resulting in an increase of old space utilization from 66.80% to 68.19%. Before the collection, the survivor space was 97.02% utilized, but after this collection it's 91.03% utilized.
REPEAT THE COLUMN HEADER STRINGThis example attaches to lvmid 21891 and takes samples at 250 millisecond intervals and displays the output as specified by -gcnew option. In addition, it uses the -h3 option to output the column header after every 3 lines of data.In addition to showing the repeating header string, this example shows that between the second and third samples, a young GC occurred. Its duration was 0.001 seconds. The collection found enough active data that the survivor space 0 utilization (S0U) would have exceeded the desired survivor size (DSS). As a result, objects were promoted to the old generation (not visible in this output), and the tenuring threshold (TT) was lowered from 31 to 2. Another collection occurs between the fifth and sixth samples. This collection found very few survivors and returned the tenuring threshold to 31.
INCLUDE A TIME STAMP FOR EACH SAMPLEThis example attaches to lvmid 21891 and takes 3 samples at 250 millisecond intervals. The -t option is used to generate a time stamp for each sample in the first column.The Timestamp column reports the elapsed time in seconds since the start of the target JVM. In addition, the -gcoldcapacity output shows the old generation capacity (OGC) and the old space capacity (OC) increasing as the heap expands to meet allocation or promotion demands. The old generation capacity (OGC) has grown from 11,696 KB to 13,820 KB after the eighty-first full garbage collection (FGC). The maximum capacity of the generation (and space) is 60,544 KB (OGCMX), so it still has room to expand.
MONITOR INSTRUMENTATION FOR A REMOTE JVMThis example attaches to lvmid 40496 on the system named remote.domain using the -gcutil option, with samples taken every second indefinitely.The lvmid is combined with the name of the remote host to construct a vmid of 40496@remote.domain. This vmid results in the use of the rmi protocol to communicate to the default jstatd server on the remote host. The jstatd server is located using the rmiregistry command on remote.domain that's bound to the default port of the rmiregistry command (port 1099).
Visit the GSP FreeBSD Man Page Interface. |