jstat.1 revision 8813:66c98bd811f1
t
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.

This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).

You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.

Arch: generic
Software: JDK 8
Date: 10 May 2011
SectDesc: Monitoring Tools
Title: jstat.1

jstat 1 "10 May 2011" "JDK 8" "Monitoring Tools"
-----------------------------------------------------------------
* Define some portability stuff
-----------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://bugs.debian.org/507673
http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
* set default formatting
-----------------------------------------------------------------
disable hyphenation
disable justification (adjust text to left margin only)
-----------------------------------------------------------------
* MAIN CONTENT STARTS HERE *
-----------------------------------------------------------------
NAME
jstat - Monitors Java Virtual Machine (JVM) statistics. This command is experimental and unsupported.
SYNOPSIS
 

jstat [ generalOption | outputOptions vmid [ interval[s|ms] [ count ] ]

generalOption A single general command-line option \f3-help or \f3-options. See General Options.

outputOptions One or more output options that consist of a single \f3statOption, plus any of the \f3-t, \f3-h, and \f3-J options. See Output Options.

vmid Virtual machine identifier, which is a string that indicates the target JVM. The general syntax is the following:

 
\f3[protocol:][//]lvmid[@hostname[:port]/servername]
 
\f3
The syntax of the \f3vmid string corresponds to the syntax of a URI. The \f3vmid 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. See Virtual Machine Identifier.

interval [s|ms] Sampling interval in the specified units, seconds (s) or milliseconds (ms). Default units are milliseconds. Must be a positive integer. When specified, the \f3jstat command produces its output at each interval.

count Number of samples to display. The default value is infinity which causes the \f3jstat command to display statistics until the target JVM terminates or the \f3jstat command is terminated. This value must be a positive integer.

DESCRIPTION
The \f3jstat command displays performance statistics for an instrumented Java HotSpot VM. The target JVM is identified by its virtual machine identifier, or \f3vmid option.
VIRTUAL MACHINE IDENTIFIER
The syntax of the \f3vmid string corresponds to the syntax of a URI:
 
\f3[protocol:][//]lvmid[@hostname[:port]/servername]
 
\f3

protocol The communications protocol. If the protocol value is omitted and a host name is not specified, then the default protocol is a platform-specific optimized local protocol. If the protocol value is omitted and a host name is specified, then the default protocol is \f3rmi.

lvmid The local virtual machine identifier for the target JVM. The \f3lvmid is a platform-specific value that uniquely identifies a JVM on a system. The \f3lvmid is the only required component of a virtual machine identifier. The \f3lvmid is typically, but not necessarily, the operating system's process identifier for the target JVM process. You can use the \f3jps command to determine the \f3lvmid. Also, you can determine the \f3lvmid on UNIX platforms with the \f3ps command, and on Windows with the Windows Task Manager.

hostname A hostname or IP address that indicates the target host. If the hostname value is omitted, then the target host is the local host.

port The default port for communicating with the remote server. If the hostname value is omitted or the protocol value specifies an optimized, local protocol, then the port value is ignored. Otherwise, treatment of the \f3port parameter is implementation-specific. For the default \f3rmi protocol, the port value indicates the port number for the rmiregistry on the remote host. If the port value is omitted and the protocol value indicates \f3rmi, then the default rmiregistry port (1099) is used.

servername The treatment of the \f3servername parameter depends on implementation. For the optimized local protocol, this field is ignored. For the \f3rmi protocol, it represents the name of the RMI remote object on the remote host.

OPTIONS
The \f3jstat command supports two types of options, general options and output options. General options cause the \f3jstat 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 OPTIONS
If you specify one of the general options, then you cannot specify any other option or parameter.

-help

Displays a help message.

-options

Displays a list of static options. See Output Options.

OUTPUT OPTIONS
If you do not specify a general option, then you can specify output options. Output options determine the content and format of the \f3jstat command's output, and consist of a single \f3statOption, plus any of the other output options (\f3-h, \f3-t, and \f3-J). The \f3statOption 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 \f3-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 \f3-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 \f3jstat command displays its output.

Note: Do not to write scripts to parse the \f3jstat command's output because the format might change in future releases. If you write scripts that parse \f3jstat command output, then expect to modify them for future releases of this tool.

-statOption

Determines the statistics information the \f3jstat command displays. The following lists the available options. Use the \f3-options general option to display the list of options for a particular platform installation. See Stat Options and Output. \f3class: Displays statistics about the behavior of the class loader. \f3compiler: Displays statistics about the behavior of the Java HotSpot VM Just-in-Time compiler. \f3gc: Displays statistics about the behavior of the garbage collected heap. \f3gccapacity: Displays statistics about the capacities of the generations and their corresponding spaces. \f3gccause: Displays a summary about garbage collection statistics (same as \f3-gcutil), with the cause of the last and current (when applicable) garbage collection events. \f3gcnew: Displays statistics of the behavior of the new generation. \f3gcnewcapacity: Displays statistics about the sizes of the new generations and its corresponding spaces. \f3gcold: Displays statistics about the behavior of the old generation and Metaspace Statistics. \f3gcoldcapacity: Displays statistics about the sizes of the old generation. \f3gcmetacapacity: Displays statistics about the sizes of the metaspace. \f3gcutil: Displays a summary about garbage collection statistics. \f3printcompilation: Displays Java HotSpot VM compilation method statistics.

-h n

Displays a column header every n samples (output rows), where n is a positive integer. Default value is 0, which displays the column header the first row of data.

-t

Display sa timestamp column as the first column of output. The time stamp is the time since the start time of the target JVM.

-JjavaOption

Passes \f3javaOption to the Java application launcher. For example, \f3-J-Xms48m sets the startup memory to 48 MB. For a complete list of options, see java(1).

STAT OPTIONS AND OUTPUT
The following information summarizes the columns that the \f3jstat command outputs for each statOption.

-class option

Class loader statistics. \f3Loaded: Number of classes loaded. \f3Bytes: Number of KBs loaded. \f3Unloaded: Number of classes unloaded. \f3Bytes: Number of Kbytes unloaded. \f3Time: Time spent performing class loading and unloading operations.

-compiler option

Java HotSpot VM Just-in-Time compiler statistics. \f3Compiled: Number of compilation tasks performed. \f3Failed: Number of compilations tasks failed. \f3Invalid: Number of compilation tasks that were invalidated. \f3Time: Time spent performing compilation tasks. \f3FailedType: Compile type of the last failed compilation. \f3FailedMethod: Class name and method of the last failed compilation.

-gc option

Garbage-collected heap statistics. \f3S0C: Current survivor space 0 capacity (KB). \f3S1C: Current survivor space 1 capacity (KB). \f3S0U: Survivor space 0 utilization (KB). \f3S1U: Survivor space 1 utilization (KB). \f3EC: Current eden space capacity (KB). \f3EU: Eden space utilization (KB). \f3OC: Current old space capacity (KB). \f3OU: Old space utilization (KB). \f3MC: Metaspace capacity (KB). \f3MU: Metacspace utilization (KB). \f3YGC: Number of young generation garbage collection events. \f3YGCT: Young generation garbage collection time. \f3FGC: Number of full GC events. \f3FGCT: Full garbage collection time. \f3GCT: Total garbage collection time.

-gccapacity option

Memory pool generation and space capacities. \f3NGCMN: Minimum new generation capacity (KB). \f3NGCMX: Maximum new generation capacity (KB). \f3NGC: Current new generation capacity (KB). \f3S0C: Current survivor space 0 capacity (KB). \f3S1C: Current survivor space 1 capacity (KB). \f3EC: Current eden space capacity (KB). \f3OGCMN: Minimum old generation capacity (KB). \f3OGCMX: Maximum old generation capacity (KB). \f3OGC: Current old generation capacity (KB). \f3OC: Current old space capacity (KB). \f3MCMN: Minimum metaspace capacity (KB). \f3MCMX: Maximum metaspace capacity (KB). \f3MC: Metaspace capacity (KB). \f3YGC: Number of Young generation GC Events. \f3FGC: Number of Full GC Events.

-gccause option

This option displays the same summary of garbage collection statistics as the \f3-gcutil option, but includes the causes of the last garbage collection event and (when applicable) the current garbage collection event. In addition to the columns listed for \f3-gcutil, this option adds the following columns. Garbage collection statistics, including garbage collection Events. \f3LGCC: Cause of last garbage collection. \f3GCC: Cause of current garbage collection.

-gcnew option

New generation statistics. \f3S0C: Current survivor space 0 capacity (KB). \f3S1C: Current survivor space 1 capacity (KB). \f3S0U: Survivor space 0 utilization (KB). \f3S1U: Survivor space 1 utilization (KB). \f3TT: Tenuring threshold. \f3MTT: Maximum tenuring threshold. \f3DSS: Desired survivor size (KB). \f3EC: Current eden space capacity (KB). \f3EU: Eden space utilization (KB). \f3YGC: Number of young generation GC events. \f3YGCT: Young generation garbage collection time.

-gcnewcapacity option

New generation space size statistics. NGCMN: Minimum new generation capacity (KB). \f3NGCMX: Maximum new generation capacity (KB). \f3NGC: Current new generation capacity (KB). \f3S0CMX: Maximum survivor space 0 capacity (KB). \f3S0C: Current survivor space 0 capacity (KB). \f3S1CMX: Maximum survivor space 1 capacity (KB). \f3S1C: Current survivor space 1 capacity (KB). \f3ECMX: Maximum eden space capacity (KB). \f3EC: Current eden space capacity (KB). \f3YGC: Number of young generation GC events. \f3FGC: Number of Full GC Events.

-gcold option

old and permanent generation statistics. \f3MC: Metaspace capacity (KB). \f3MU: Metaspace utilization (KB). \f3OC: Current old space capacity (KB). \f3OU: old space utilization (KB). \f3YGC: Number of young generation GC events. \f3FGC: Number of full GC events. \f3FGCT: Full garbage collection time. \f3GCT: Total garbage collection time.

-gcoldcapacity option

Old generation statistics. \f3OGCMN: Minimum old generation capacity (KB). \f3OGCMX: Maximum old generation capacity (KB). \f3OGC: Current old generation capacity (KB). \f3OC: Current old space capacity (KB). \f3YGC: Number of young generation GC events. \f3FGC: Number of full GC events. \f3FGCT: Full garbage collection time. \f3GCT: Total garbage collection time.

-gcmetacapacity option

Permanent generation statistics. \f3MCMN: Minimum metaspace capacity (KB). \f3MCMX: Maximum metaspace capacity (KB). \f3MC: Metaspace capacity (KB). \f3YGC: Number of young generation GC events. \f3FGC: Number of full GC events. \f3FGCT: Full garbage collection time. \f3GCT: Total garbage collection time.

-gcutil option

Summary of garbage collection statistics. \f3S0: Survivor space 0 utilization as a percentage of the space's current capacity. \f3S1: Survivor space 1 utilization as a percentage of the space's current capacity. \f3E: Eden space utilization as a percentage of the space's current capacity. \f3O: Old space utilization as a percentage of the space's current capacity. \f3M: Metaspace utilization as a percentage of the space's current capacity. \f3YGC: Number of young generation GC events. \f3YGCT: Young generation garbage collection time. \f3FGC: Number of full GC events. \f3FGCT: Full garbage collection time. \f3GCT: Total garbage collection time.

-printcompilation option

Java HotSpot VM compiler method statistics. \f3Compiled: Number of compilation tasks performed by the most recently compiled method. \f3Size: Number of bytes of byte code of the most recently compiled method. \f3Type: Compilation type of the most recently compiled method. \f3Method: Class name and method name identifying the most recently compiled method. Class name uses slash (/) instead of dot (.) as a name space separator. Method name is the method within the specified class. The format for these two fields is consistent with the HotSpot \f3-XX:+PrintComplation option.

EXAMPLES
This section presents some examples of monitoring a local JVM with an lvmid of 21891.
THE GCUTIL OPTION
This example attaches to lvmid 21891 and takes 7 samples at 250 millisecond intervals and displays the output as specified by the -\f3gcutil option.

The output of this example shows that a young generation collection occurred between the third and fourth sample. The collection took 0.001 seconds and promoted objects from the eden space (E) to the old space (O), resulting in an increase of old space utilization from 9.49% to 9.51%. Before the collection, the survivor space was 12.44% utilized, but after this collection it is only 7.74% utilized.

 
\f3jstat -gcutil 21891 250 7
 
\f3 S0 S1 E O M YGC YGCT FGC FGCT GCT
 
\f30.00 99.74 13.49 7.86 95.82 3 0.124 0 0.000 0.124
 
\f30.00 99.74 13.49 7.86 95.82 3 0.124 0 0.000 0.124
 
\f30.00 99.74 13.49 7.86 95.82 3 0.124 0 0.000 0.124
 
\f30.00 99.74 13.49 7.86 95.82 3 0.124 0 0.000 0.124
 
\f30.00 99.74 13.80 7.86 95.82 3 0.124 0 0.000 0.124
 
\f30.00 99.74 13.80 7.86 95.82 3 0.124 0 0.000 0.124
 
\f30.00 99.74 13.80 7.86 95.82 3 0.124 0 0.000 0.124
 
\f3
REPEAT THE COLUMN HEADER STRING
This example attaches to lvmid 21891 and takes samples at 250 millisecond intervals and displays the output as specified by \f3-gcutil option. In addition, it uses the \f3-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.

 
\f3jstat -gcnew -h3 21891 250
 
\f3 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
 
\f3 64.0 64.0 0.0 31.7 31 31 32.0 512.0 178.6 249 0.203
 
\f3 64.0 64.0 0.0 31.7 31 31 32.0 512.0 355.5 249 0.203
 
\f3 64.0 64.0 35.4 0.0 2 31 32.0 512.0 21.9 250 0.204
 
\f3 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
 
\f3 64.0 64.0 35.4 0.0 2 31 32.0 512.0 245.9 250 0.204
 
\f3 64.0 64.0 35.4 0.0 2 31 32.0 512.0 421.1 250 0.204
 
\f3 64.0 64.0 0.0 19.0 31 31 32.0 512.0 84.4 251 0.204
 
\f3 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
 
\f3 64.0 64.0 0.0 19.0 31 31 32.0 512.0 306.7 251 0.204
 
\f3
INCLUDE A TIME STAMP FOR EACH SAMPLE
This example attaches to lvmid 21891 and takes 3 samples at 250 millisecond intervals. The \f3-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 \f3-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 to from 11,696 KB to 13820 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.

 
\f3Timestamp OGCMN OGCMX OGC OC YGC FGC FGCT GCT
 
\f3 150.1 1408.0 60544.0 11696.0 11696.0 194 80 2.874 3.799
 
\f3 150.4 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
 
\f3 150.7 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
 
\f3
MONITOR INSTRUMENTATION FOR A REMOTE JVM
This example attaches to lvmid 40496 on the system named remote.domain using the \f3-gcutil option, with samples taken every second indefinitely.

The lvmid is combined with the name of the remote host to construct a vmid of \f340496@remote.domain. This vmid results in the use of the \f3rmi protocol to communicate to the default \f3jstatd server on the remote host. The \f3jstatd server is located using the rmiregistry on \f3remote.domain that is bound to the default rmiregistry port (port 1099).

 
\f3jstat -gcutil 40496@remote.domain 1000
 
\f3... output omitted
 
\f3
SEE ALSO

0.2i java(1)

0.2i jps(1)

0.2i jstatd(1)

0.2i rmiregistry(1)

'pl 8.5i 'bp