1jstat(1)                    General Commands Manual                   jstat(1)
2
3
4

NAME

6       jstat - Java Virtual Machine Statistics Monitoring Tool
7

SYNOPSIS

9       jstat [ generalOption | outputOptionsvmid [interval[s|ms] [count]] ]
10

PARAMETERS

12       generalOption
13          A single general command-line option (-help, -options, or -version)
14
15       outputOptions
16          One  or more output options, consisting of a single statOption, plus
17          any of the -t, -h, and -J options.
18
19       vmid
20          Virtual machine identifier, a string indicating the target Java vir‐
21          tual machine (JVM). The general syntax is
22          [protocol:][//]lvmid[@hostname[:port]/servername]
23          The syntax of the vmid string largely corresponds to the syntax of a
24          URI. The vmid can vary from a simple integer  representing  a  local
25          JVM  to a more complex construction specifying a communications pro‐
26          tocol, port number, and other  implementation-specific  values.  See
27          Virtual Machine Identifier for details.
28
29       interval[s|ms]
30          Sampling  interval  in the specified units, seconds (s) or millisec‐
31          onds (ms). Default units are milliseconds.  Must be a positive inte‐
32          ger.  If specified, jstat will produce its output at each interval.
33
34       count
35          Number  of  samples  to display. Default value is infinity; that is,
36          jstat displays statistics until the target  JVM  terminates  or  the
37          jstat command is terminated.  Must be a positive integer.
38

DESCRIPTION

40       The  jstat  tool  displays  performance  statistics for an instrumented
41       HotSpot Java virtual machine (JVM). The target JVM is identified by its
42       virtual machine identifier, or vmid option described below.
43
44       NOTE:  This  utility  is unsupported and may not be available in future
45       versions of the JDK. It is not currently available on  Windows  98  and
46       Windows ME. platforms.
47
48   VIRTUAL MACHINE IDENTIFIER
49       The  syntax  of  the vmid string largely corresponds to the syntax of a
50       URI:
51       [protocol:][//]lvmid[@hostname][:port][/servername]
52
53       protocol
54          The communications protocol. If the protocol is omitted and a  host‐
55          name  is  not specified, the default protocol is a platform specific
56          optimized local protocol. If the protocol is omitted and a  hostname
57          is specified, then the default protocol is rmi.
58
59       lvmid
60          The  local  virtual machine identifier for the target JVM. The lvmid
61          is a platform-specific value that uniquely identifies  a  JVM  on  a
62          system.  The  lvmid  is  the  only  required  component of a virtual
63          machine identifier. The lvmid is typically, but not necessarily, the
64          operating  system's  process  identifier for the target JVM process.
65          You can use the jps command to determine the lvmid.  Also,  you  can
66          determine  lvmid  on Unix platforms with the ps command, and on Win‐
67          dows with the Windows Task Manager.
68
69       hostname
70          A hostname or IP address indicating the target host. If hostname  is
71          omitted, then the target host is the local host.
72
73       port
74          The  default  port  for communicating with the remote server. If the
75          hostname is omitted or the protocol specifies  an  optimized,  local
76          protocol,  then  port  is  ignored. Otherwise, treatment of the port
77          parameter is implementation specific. For the default rmi  protocol,
78          the port indicates the port number for the rmiregistry on the remote
79          host. If port is omitted,  and  protocol  indicates  rmi,  then  the
80          default rmiregistry port (1099) is used.
81
82       servername
83          The  treatment  of this parameter depends on implementation. For the
84          optimized local protocol, this field is ignored. For the rmi  proto‐
85          col,  it  represents the name of the RMI remote object on the remote
86          host.
87

OPTIONS

89       The jstat command supports two types of options,  general  options  and
90       output options. General options cause jstat to display simple usage and
91       version information. Output options determine the content and format of
92       the statistical output.
93
94       NOTE:  All  options,  and  their functionality are subject to change or
95       removal in future releases.
96
97   GENERAL
98       OPTIONS
99
100       If you specify one of the general options, you cannot specify any other
101       option or parameter.
102
103       -help
104          Display help message.
105
106       -version
107          Display version information.
108
109       -options
110          Display  list  of statistics options. See the Output Options section
111          below.
112
113   OUTPUT
114       OPTIONS
115
116       If you do not specify a general option, then  you  can  specify  output
117       options.  Output  options  determine  the content and format of jstat's
118       output, and consist of a single statOption, plus any of the other  out‐
119       put options (-h, -t, and -J).  The statOption must come first.
120
121       Output is formatted as a table, with columns are separated by spaces. A
122       header row with titles describes the columns.  Use the -h option to set
123       the  frequency  at  which the header is displayed.  Column header names
124       are generally consistent between the different options. In general,  if
125       two  options  provide a column with the same name, then the data source
126       for the two columns are the same.
127
128       Use the -t option to display a time stamp column, labeled Timestamp  as
129       the  first  column of output. The Timestamp column contains the elapsed
130       time, in seconds, since startup of the target JVM.  The  resolution  of
131       the time stamp is dependent on various factors and is subject to varia‐
132       tion due to delayed thread scheduling on heavily loaded systems.
133
134       Use the interval and count parameters to determine how  frequently  and
135       how many times, respectively, jstat displays its output.
136
137       NOTE:  You  are  advised  not  to write scripts to parse jstat's output
138       since the format may change in future releases. If you choose to  write
139       scripts  that  parse  jstat  output,  expect  to modify them for future
140       releases of this tool.
141
142       -statOption
143          Determines the statistics information that jstat displays. The  fol‐
144          lowing  table lists the available options.  Use the -options general
145          option to display the list of  options  for  a  particular  platform
146          installation.
147
148
149       -hn
150          Display  a column header every n samples (output rows), where n is a
151          positive integer. Default value is  0,  which  displays  the  column
152          header above the first row of data.
153
154       -tn
155          Display  a timestamp column as the first column of output. The time‐
156          stamp is the the time since the start time of the target JVM.
157
158       -JjavaOption
159          Pass javaOption to  the  java  application  launcher.  For  example,
160          -J-Xms48m  sets  the  startup memory to 48 megabytes. For a complete
161          list of options, see the following documents:
162
163          * java - the Java application launcher (Solaris) @
164            http://java.sun.com/javase/6/docs/tech
165            notes/tools/solaris/java.html
166
167          * java - the Java application launcher (Linux) @
168            http://java.sun.com/javase/6/docs/technotes/tools/linux/java.html
169
170          * java - the Java application launcher (Windows)
171
172   STATOPTIONS AND
173       OUTPUT
174
175       The following tables summarize the columns that jstat outputs for each
176       statOption.
177
178   -class Option
179   -compiler
180       Option
181
182
183   -gc Option
184   -gccapacity Option
185   -gccause
186       Option
187
188       This option displays the same summary of garbage collection statistics
189       as the -gcutil option, but includes the causes of the last garbage col‐
190       lection event and (if applicable) the current garbage collection event.
191       In addition to the columns listed for -gcutil, this option adds the
192       following columns:
193
194
195   -gcnew Option
196   -gcnewcapacity Option
197   -gcold Option
198   -gcoldcapacity Option
199   -gcpermcapacity Option
200   -gcutil
201       Option
202
203
204   -printcompilation Option
205
206       This section presents some examples of monitoring a local JVM with a
207       lvmid of 21891.
208
209   Using the gcutil option
210       This example attaches to lvmid 21891 and takes 7 samples at 250 mil‐
211       lisecond intervals and displays the output as specified by the -gcutil
212       option.
213       jstat -gcutil 21891 250 7
214
215         S0     S1     E      O      P     YGC    YGCT    FGC    FGCT     GCT
216
217        12.44   0.00  27.20   9.49  96.70    78    0.176     5    0.495    0.672
218
219        12.44   0.00  62.16   9.49  96.70    78    0.176     5    0.495    0.672
220
221        12.44   0.00  83.97   9.49  96.70    78    0.176     5    0.495    0.672
222
223         0.00   7.74   0.00   9.51  96.70    79    0.177     5    0.495    0.673
224
225         0.00   7.74  23.37   9.51  96.70    79    0.177     5    0.495    0.673
226
227         0.00   7.74  43.82   9.51  96.70    79    0.177     5    0.495    0.673
228
229         0.00   7.74  58.11   9.51  96.71    79    0.177     5    0.495    0.673
230
231       The output of this example shows that a young generation collection
232       occurred between the 3rd and 4th sample. The collection took 0.001 sec‐
233       onds and promoted objects from the eden space (E) to the old space (O),
234       resulting in an increase of old space utilization from 9.49% to 9.51%.
235       Before the collection, the survivor space was 12.44% utilized, but
236       after this collection it is only 7.74% utilized.
237
238   Repeating the column header
239       string
240
241       This example attaches to lvmid 21891 and takes samples at 250 millisec‐
242       ond intervals and displays the output as specified by -gcutil option.
243       In addition, it uses the -h3 option to output the column header after
244       every 3 lines of data.
245       jstat -gcnew -h3 21891 250
246
247        S0C    S1C    S0U    S1U   TT MTT  DSS      EC       EU     YGC     YGCT
248
249         64.0   64.0    0.0   31.7 31  31   32.0    512.0    178.6    249    0.203
250
251         64.0   64.0    0.0   31.7 31  31   32.0    512.0    355.5    249    0.203
252
253         64.0   64.0   35.4    0.0  2  31   32.0    512.0     21.9    250    0.204
254
255        S0C    S1C    S0U    S1U   TT MTT  DSS      EC       EU     YGC     YGCT
256
257         64.0   64.0   35.4    0.0  2  31   32.0    512.0    245.9    250    0.204
258
259         64.0   64.0   35.4    0.0  2  31   32.0    512.0    421.1    250    0.204
260
261         64.0   64.0    0.0   19.0 31  31   32.0    512.0     84.4    251    0.204
262
263        S0C    S1C    S0U    S1U   TT MTT  DSS      EC       EU     YGC     YGCT
264
265         64.0   64.0    0.0   19.0 31  31   32.0    512.0    306.7    251    0.204
266
267       In addition to showing the repeating header string, this example shows
268       that between the 2nd and 3rd samples, a young GC occurred. Its duration
269       was 0.001 seconds. The collection found enough live data that the sur‐
270       vivor space 0 utilization (S0U) would would have exceeded the desired
271       survivor Size (DSS). As a result, objects were promoted to the old gen‐
272       eration (not visible in this output), and the tenuring threshold (TT)
273       was lowered from 31 to 2.
274
275       Another collection occurs between the 5th and 6th samples. This collec‐
276       tion found very few survivors and returned the tenuring threshold to
277       31.
278
279   Including a
280       time stamp for each sample
281
282       This example attaches to lvmid 21891 and takes 3 samples at 250 mil‐
283       lisecond intervals. The -t option is used to generate a time stamp for
284       each sample in the first column.
285       jstat -gcoldcapacity -t 21891 250 3
286
287       Timestamp          OGCMN        OGCMX         OGC           OC       YGC   FGC    FGCT    GCT
288
289                 150.1       1408.0      60544.0      11696.0      11696.0   194    80    2.874   3.799
290
291                 150.4       1408.0      60544.0      13820.0      13820.0   194    81    2.938   3.863
292
293                 150.7       1408.0      60544.0      13820.0      13820.0   194    81    2.938   3.863
294
295       The Timestamp column reports the elapsed time in seconds since the
296       start of the target JVM. In addition, the -gcoldcapacity output shows
297       the old generation capacity (OGC) and the old space capacity (OC)
298       increasing as the heap expands to meet allocation and/or promotion
299       demands. The old generation capacity (OGC) has grown to from 11696 KB
300       to 13820 KB after the 81st Full GC (FGC). The maximum capacity of the
301       generation (and space) is 60544 KB (OGCMX), so it still has room to
302       expand.
303
304   Monitor
305       instrumentation for a remote JVM
306
307       This example attaches to lvmid 40496 on the system named remote.domain
308       using the -gcutil option, with samples taken every second indefinitely.
309       jstat -gcutil 40496@remote.domain 1000
310
311
312       The lvmid is combined with the name of the remote host to construct a
313       vmid of 40496@remote.domain. This vmid results in the use of the rmi
314       protocol to communicate to the default jstatd server on the remote
315       host. The jstatd server is located using the rmiregistry on
316       remote.domain that is bound to the default rmiregistry port (port
317       1099).
318

SEE ALSO

320          * java - the Java Application Launcher
321
322          * jps - the Java Process Status Application
323
324          * jstatd - the jvmstat daemon
325
326          * rmiregistry - the Java Remote Object Registry
327
328
329
330
331                                  06 Aug 2006                         jstat(1)
Impressum