Name

jstat - Java Virtual Machine Statistics Monitoring Tool

SYNOPSIS

f3
f3jstat [ f2generalOption | f2outputOptions f2vmid [f2interval[s|ms] [f2count]] ]

PARAMETERS

generalOption A single general command-line option (-help or -options)

outputOptions One or more output options, consisting of a single f2statOption, plus any of the -t, -h, and -J options.

vmid Virtual machine identifier, a string indicating the target Java virtual machine (JVM). The general syntax is

f3
[f4protocolf3:][//]f4lvmid[@f2hostname[:f2port]/f2servername]

The syntax of the vmid string largely corresponds to the syntax of a URI. The f2vmid can vary from a simple integer representing a local JVM to a more complex construction specifying a communications protocol, port number, and other implementation-specific values. See Virtual Machine Identifier for details.

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

count Number of samples to display. Default value is infinity; that is, f3jstat displays statistics until the target JVM terminates or the f3jstat command is terminated. Must be a positive integer.

DESCRIPTION

The f3jstat tool displays performance statistics for an instrumented HotSpot Java virtual machine (JVM). The target JVM is identified by its virtual machine identifier, or f2vmid option described below.

f3NOTE: This utility is unsupported and may not be available in future versions of the JDK. It is not currently available on Windows 98 and Windows ME. platforms.

VIRTUAL MACHINE IDENTIFIER

The syntax of the f2vmid string largely corresponds to the syntax of a URI:

f3
[f4protocolf3:][//]f4lvmid[@f2hostname][:f2port][/f2servername]

protocol The communications protocol. If the f2protocol is omitted and a f2hostname is not specified, the default protocol is a platform specific optimized local protocol. If the f2protocol is omitted and a f2hostname is specified, then the default protocol is f3rmi.

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

hostname A hostname or IP address indicating the target host. If f2hostname is omitted, then the target host is the local host.

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

servername The treatment of this 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 f3jstat to display simple usage and version information. Output options determine the content and format of the statistical output.

f3NOTE: All options, and their functionality are subject to change or removal in future releases.

GENERAL OPTIONS

If you specify one of the general options, you cannot specify any other option or parameter.

-help Display help message.

-options Display list of statistics options. See the Output Options section below.

OUTPUT OPTIONS

If you do not specify a general option, then you can specify output options. Output options determine the content and format of f3jstat's output, and consist of a single f2statOption, plus any of the other output options (-h, -t, and -J). The f2statOption must come first.

Output is formatted as a table, with columns 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 generally consistent between the different options. In general, if two options provide a column with the same name, then the data source for the two columns are the same.

Use the f3-t option to display a time stamp column, labeled f2Timestamp as the first column of output. The f2Timestamp column contains the elapsed time, in seconds, since startup of the target JVM. 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 f2interval and f2count parameters to determine how frequently and how many times, respectively, f3jstat displays its output.

f3NOTE: You are advised not to write scripts to parse f3jstat's output since the format may change in future releases. If you choose to write scripts that parse f3jstat output, expect to modify them for future releases of this tool.

-statOption Determines the statistics information that f3jstat displays. The following table lists the available options. Use the f3-options general option to display the list of options for a particular platform installation.


Statistics on the behavior of the class loader.

Statistics of the behavior of the HotSpot Just-in-Time compiler.

Statistics of the behavior of the garbage collected heap.

Statistics of the capacities of the generations and their corresponding spaces.

Summary of garbage collection statistics (same as f3-gcutil), with the cause of the last and current (if applicable) garbage collection events.

Statistics of the behavior of the new generation.

Statistics of the sizes of the new generations and its corresponding spaces.

Statistics of the behavior of the old and permanent generations.

Statistics of the sizes of the old generation.

Statistics of the sizes of the permanent generation.

Summary of garbage collection statistics.

HotSpot compilation method statistics.
h'|n(40u'f3Optionh'|n(41u'f3Displays...
h'|n(40u'classh'|n(41u'
h'|n(40u'compilerh'|n(41u'
h'|n(40u'gch'|n(41u'
h'|n(40u'gccapacityh'|n(41u'
h'|n(40u'gccauseh'|n(41u'
h'|n(40u'gcnewh'|n(41u'
h'|n(40u'gcnewcapacityh'|n(41u'
h'|n(40u'gcoldh'|n(41u'
h'|n(40u'gcoldcapacityh'|n(41u'
h'|n(40u'gcpermcapacityh'|n(41u'
h'|n(40u'gcutilh'|n(41u'
h'|n(40u'printcompilationh'|n(41u'
-h n 
Display a column header every f2n samples (output rows), where f2n is a positive integer. Default value is 0, which displays the column header above the first row of data. 
-t 
Display a timestamp column as the first column of output. The timestamp is the time since the start time of the target JVM. 
-JjavaOption 
Pass f2javaOption to the f3java application launcher. For example, f3-J-Xms48m sets the startup memory to 48 megabytes. For a complete list of options, see java(1) 
 

STATOPTIONS AND OUTPUT

The following tables summarize the columns that f3jstat outputs for each f2statOption.

-class Option


Number of classes unloaded.

Number of Kbytes unloaded.

Time spent performing class load and unload operations.
h'|n(40u'Class Loader Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'Loadedh'|n(41u'Number of classes loaded.
h'|n(40u'Bytesh'|n(41u'Number of Kbytes loaded.
h'|n(40u'Unloadedh'|n(41u'
h'|n(40u'Bytesh'|n(41u'
h'|n(40u'Timeh'|n(41u'
 

-compiler Option


Number of compilation tasks performed.

Number of compilation tasks that failed.

Number of compilation tasks that were invalidated.

Time spent performing compilation tasks.

Compile type of the last failed compilation.

Class name and method for the last failed compilation.
h'|n(40u'HotSpot Just-In-Time Compiler Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'Compiledh'|n(41u'
h'|n(40u'Failedh'|n(41u'
h'|n(40u'Invalidh'|n(41u'
h'|n(40u'Timeh'|n(41u'
h'|n(40u'FailedTypeh'|n(41u'
h'|n(40u'FailedMethodh'|n(41u'
 

-gc Option


Current survivor space 0 capacity (KB).

Current survivor space 1 capacity (KB).

Survivor space 0 utilization (KB).

Survivor space 1 utilization (KB).

Current eden space capacity (KB).

Eden space utilization (KB).

Current old space capacity (KB).

Old space utilization (KB).

Current permanent space capacity (KB).

Permanent space utilization (KB).

Number of young generation GC Events.

Young generation garbage collection time.

Full garbage collection time.

Total garbage collection time.
h'|n(40u'Garbage-collected heap statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'S0Ch'|n(41u'
h'|n(40u'S1Ch'|n(41u'
h'|n(40u'S0Uh'|n(41u'
h'|n(40u'S1Uh'|n(41u'
h'|n(40u'ECh'|n(41u'
h'|n(40u'EUh'|n(41u'
h'|n(40u'OCh'|n(41u'
h'|n(40u'OUh'|n(41u'
h'|n(40u'PCh'|n(41u'
h'|n(40u'PUh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'YGCTh'|n(41u'
h'|n(40u'FGCh'|n(41u'Number of full GC events.
h'|n(40u'FGCTh'|n(41u'
h'|n(40u'GCTh'|n(41u'
 

-gccapacity Option


Minimum new generation capacity (KB).

Maximum new generation capacity (KB).

Current new generation capacity (KB).

Current survivor space 0 capacity (KB).

Current survivor space 1 capacity (KB).

Current eden space capacity (KB).

Minimum old generation capacity (KB).

Maximum old generation capacity (KB).

Current old generation capacity (KB).

Current old space capacity (KB).

Minimum permanent generation capacity (KB).

Maximum Permanent generation capacity (KB).

Current Permanent generation capacity (KB).

Current Permanent space capacity (KB).

Number of Young generation GC Events.
h'|n(40u'Memory Pool Generation and Space Capacitiesh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'NGCMNh'|n(41u'
h'|n(40u'NGCMXh'|n(41u'
h'|n(40u'NGCh'|n(41u'
h'|n(40u'S0Ch'|n(41u'
h'|n(40u'S1Ch'|n(41u'
h'|n(40u'ECh'|n(41u'
h'|n(40u'OGCMNh'|n(41u'
h'|n(40u'OGCMXh'|n(41u'
h'|n(40u'OGCh'|n(41u'
h'|n(40u'OCh'|n(41u'
h'|n(40u'PGCMNh'|n(41u'
h'|n(40u'PGCMXh'|n(41u'
h'|n(40u'PGCh'|n(41u'
h'|n(40u'PCh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'FGCh'|n(41u'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 (if applicable) the current garbage collection event. In addition to the columns listed for f3-gcutil, this option adds the following columns:


Cause of last Garbage Collection.

Cause of current Garbage Collection.
h'|n(40u'Garbage Collection Statistics, Including GC Eventsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'LGCCh'|n(41u'
h'|n(40u'GCCh'|n(41u'
 

-gcnew Option


Current survivor space 0 capacity (KB).

Current survivor space 1 capacity (KB).

Survivor space 0 utilization (KB).

Survivor space 1 utilization (KB).

Maximum tenuring threshold.

Desired survivor size (KB).

Current eden space capacity (KB).

Eden space utilization (KB).

Number of young generation GC events.

Young generation garbage collection time.
h'|n(40u'New Generation Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'S0Ch'|n(41u'
h'|n(40u'S1Ch'|n(41u'
h'|n(40u'S0Uh'|n(41u'
h'|n(40u'S1Uh'|n(41u'
h'|n(40u'TTh'|n(41u'Tenuring threshold.
h'|n(40u'MTTh'|n(41u'
h'|n(40u'DSSh'|n(41u'
h'|n(40u'ECh'|n(41u'
h'|n(40u'EUh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'YGCTh'|n(41u'
 

-gcnewcapacity Option


Minimum new generation capacity (KB).

Maximum new generation capacity (KB).

Current new generation capacity (KB).

Maximum survivor space 0 capacity (KB).

Current survivor space 0 capacity (KB).

Maximum survivor space 1 capacity (KB).

Current survivor space 1 capacity (KB).

Maximum eden space capacity (KB).

Current eden space capacity (KB).

Number of young generation GC events.
h'|n(40u'New Generation Space Size Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'NGCMNh'|n(41u'
h'|n(40u'NGCMXh'|n(41u'
h'|n(40u'NGCh'|n(41u'
h'|n(40u'S0CMXh'|n(41u'
h'|n(40u'S0Ch'|n(41u'
h'|n(40u'S1CMXh'|n(41u'
h'|n(40u'S1Ch'|n(41u'
h'|n(40u'ECMXh'|n(41u'
h'|n(40u'ECh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'FGCh'|n(41u'Number of Full GC Events.
 

-gcold Option


Current permanent space capacity (KB).

Permanent space utilization (KB).

Current old space capacity (KB).

old space utilization (KB).

Number of young generation GC events.

Full garbage collection time.

Total garbage collection time.
h'|n(40u'Old and Permanent Generation Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'PCh'|n(41u'
h'|n(40u'PUh'|n(41u'
h'|n(40u'OCh'|n(41u'
h'|n(40u'OUh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'FGCh'|n(41u'Number of full GC events.
h'|n(40u'FGCTh'|n(41u'
h'|n(40u'GCTh'|n(41u'
 

-gcoldcapacity Option


Minimum old generation capacity (KB).

Maximum old generation capacity (KB).

Current old generation capacity (KB).

Current old space capacity (KB).

Number of young generation GC events.

Full garbage collection time.

Total garbage collection time.
h'|n(40u'Old Generation Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'OGCMNh'|n(41u'
h'|n(40u'OGCMXh'|n(41u'
h'|n(40u'OGCh'|n(41u'
h'|n(40u'OCh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'FGCh'|n(41u'Number of full GC events.
h'|n(40u'FGCTh'|n(41u'
h'|n(40u'GCTh'|n(41u'
 

-gcpermcapacity Option


Minimum permanent generation capacity (KB).

Maximum permanent generation capacity (KB).

Current permanent generation capacity (KB).

Current permanent space capacity (KB).

Number of young generation GC events.

Full garbage collection time.

Total garbage collection time.
h'|n(40u'Permanent Generation Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'PGCMNh'|n(41u'
h'|n(40u'PGCMXh'|n(41u'
h'|n(40u'PGCh'|n(41u'
h'|n(40u'PCh'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'FGCh'|n(41u'Number of full GC events.
h'|n(40u'FGCTh'|n(41u'
h'|n(40u'GCTh'|n(41u'
 

-gcutil Option


Survivor space 0 utilization as a percentage of the space's current capacity.

Survivor space 1 utilization as a percentage of the space's current capacity.

Eden space utilization as a percentage of the space's current capacity.

Old space utilization as a percentage of the space's current capacity.

Permanent space utilization as a percentage of the space's current capacity.

Number of young generation GC events.

Young generation garbage collection time.

Full garbage collection time.

Total garbage collection time.
h'|n(40u'Summary of Garbage Collection Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'S0h'|n(41u'
h'|n(40u'S1h'|n(41u'
h'|n(40u'Eh'|n(41u'
h'|n(40u'Oh'|n(41u'
h'|n(40u'Ph'|n(41u'
h'|n(40u'YGCh'|n(41u'
h'|n(40u'YGCTh'|n(41u'
h'|n(40u'FGCh'|n(41u'Number of full GC events.
h'|n(40u'FGCTh'|n(41u'
h'|n(40u'GCTh'|n(41u'
 

-printcompilation Option


Number of compilation tasks performed by the most recently compiled method.

Number of bytes of bytecode of the most recently compiled method.

Compilation type of the most recently compiled method.

Class name and method name identifying the most recently compiled method. Class name uses "/" instead of "." as namespace separator. Method name is the method within the given class. The format for these two fields is consistent with the HotSpot - f3XX:+PrintComplation option.
h'|n(40u'HotSpot Compiler Method Statisticsh'|n(41u'
h'|n(40u'f3Columnh'|n(41u'f3Description
h'|n(40u'Compiledh'|n(41u'
h'|n(40u'Sizeh'|n(41u'
h'|n(40u'Typeh'|n(41u'
h'|n(40u'Methodh'|n(41u'
 

EXAMPLES

This section presents some examples of monitoring a local JVM with a f2lvmid of 21891.

Using the gcutil option

This example attaches to f2lvmid 21891 and takes 7 samples at 250 millisecond intervals and displays the output as specified by the f3-gcutil option.

f3
f3jstat -gcutil 21891 250 7

    S0 S1 E O P YGC YGCT FGC FGCT GCT
   12.44 0.00 27.20 9.49 96.70 78 0.176 5 0.495 0.672
   12.44 0.00 62.16 9.49 96.70 78 0.176 5 0.495 0.672
   12.44 0.00 83.97 9.49 96.70 78 0.176 5 0.495 0.672
    0.00 7.74 0.00 9.51 96.70 79 0.177 5 0.495 0.673
    0.00 7.74 23.37 9.51 96.70 79 0.177 5 0.495 0.673
    0.00 7.74 43.82 9.51 96.70 79 0.177 5 0.495 0.673
    0.00 7.74 58.11 9.51 96.71 79 0.177 5 0.495 0.673
 

The output of this example shows that a young generation collection occurred between the 3rd and 4th 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.

Repeating the column header string

This example attaches to f2lvmid 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.

f3
f3jstat -gcnew -h3 21891 250

   S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
    64.0 64.0 0.0 31.7 31 31 32.0 512.0 178.6 249 0.203
    64.0 64.0 0.0 31.7 31 31 32.0 512.0 355.5 249 0.203
    64.0 64.0 35.4 0.0 2 31 32.0 512.0 21.9 250 0.204
   S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
    64.0 64.0 35.4 0.0 2 31 32.0 512.0 245.9 250 0.204
    64.0 64.0 35.4 0.0 2 31 32.0 512.0 421.1 250 0.204
    64.0 64.0 0.0 19.0 31 31 32.0 512.0 84.4 251 0.204
   S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
    64.0 64.0 0.0 19.0 31 31 32.0 512.0 306.7 251 0.204
 

In addition to showing the repeating header string, this example shows that between the 2nd and 3rd samples, a young GC occurred. Its duration was 0.001 seconds. The collection found enough live data that the survivor space 0 utilization (S0U) would 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 5th and 6th samples. This collection found very few survivors and returned the tenuring threshold to 31.

Including a time stamp for each sample

This example attaches to f2lvmid 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.

f3
f3jstat -gcoldcapacity -t 21891 250 3

  Timestamp OGCMN OGCMX OGC OC YGC FGC FGCT GCT
    150.1 1408.0 60544.0 11696.0 11696.0 194 80 2.874 3.799
    150.4 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
    150.7 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
 

The f2Timestamp 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 and/or promotion demands. The old generation capacity (OGC) has grown to from 11696 KB to 13820 KB after the 81st Full GC (FGC). The maximum capacity of the generation (and space) is 60544 KB (OGCMX), so it still has room to expand.

Monitor instrumentation for a remote JVM

This example attaches to f2lvmid 40496 on the system named f2remote.domain using the f3-gcutil option, with samples taken every second indefinitely.

f3
f3jstat -gcutil 40496@remote.domain 1000

 
 

The f2lvmid is combined with the name of the remote host to construct a f2vmid of f240496@remote.domain. This f2vmid 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 f3rmiregistry on f2remote.domain that is bound to the default f3rmiregistry port (port 1099).

SEE ALSO

o java(1) - the Java Application Launcher

o jps(1) - the Java Process Status Application

o jstatd(1) - the jvmstat daemon

o rmiregistry(1) - the Java Remote Object Registry