1jstat(1) General Commands Manual jstat(1)
2
3
4
6 jstat - Java Virtual Machine Statistics Monitoring Tool
7
9 jstat [ generalOption | outputOptions vmid [interval[s|ms] [count]] ]
10
11
13 generalOption
14 A single general command-line option (-help, -options, or -ver‐
15 sion)
16
17 outputOptions
18 One or more output options, consisting of a single statOption,
19 plus any of the -t, -h, and -J options.
20
21 vmid
22 Virtual machine identifier, a string indicating the target Java
23 virtual machine (JVM). The general syntax is
24 [protocol:][//]lvmid[@hostname[:port]/servername]
25 The syntax of the vmid string largely corresponds to the syntax
26 of a URI. The vmid can vary from a simple integer representing a
27 local JVM to a more complex construction specifying a communica‐
28 tions protocol, port number, and other implementation-specific
29 values. See Virtual Machine Identifier for details.
30
31 interval[s|ms]
32 Sampling interval in the specified units, seconds (s) or mil‐
33 liseconds (ms). Default units are milliseconds. Must be a posi‐
34 tive integer. If specified, jstat will produce its output at each
35 interval.
36
37 count
38 Number of samples to display. Default value is infinity; that is,
39 jstat displays statistics until the target JVM terminates or the
40 jstat command is terminated. Must be a positive integer.
41
42
44 The jstat tool displays performance statistics for an instrumented
45 HotSpot Java virtual machine (JVM). The target JVM is identified by its
46 virtual machine identifier, or vmid option described below.
47
48 NOTE: This utility is unsupported and may not be available in future
49 versions of the JDK. It is not currently available on Windows 98 and
50 Windows ME. platforms.
51
52
53 VIRTUAL MACHINE IDENTIFIER
54 The syntax of the vmid string largely corresponds to the syntax of a
55 URI:
56
57 [protocol:][//]lvmid[@hostname][:port][/servername]
58
59
60 protocol
61 The communications protocol. If the protocol is omitted and a
62 hostname is not specified, the default protocol is a platform
63 specific optimized local protocol. If the protocol is omitted and
64 a hostname is specified, then the default protocol is rmi.
65
66 lvmid
67 The local virtual machine identifier for the target JVM. The
68 lvmid is a platform-specific value that uniquely identifies a JVM
69 on a system. The lvmid is the only required component of a vir‐
70 tual machine identifier. The lvmid is typically, but not neces‐
71 sarily, the operating system's process identifier for the target
72 JVM process. You can use the jps(1) command to determine the
73 lvmid. Also, you can determine lvmid on Unix platforms with the
74 ps command, and on Windows with the Windows Task Manager.
75
76 hostname
77 A hostname or IP address indicating the target host. If hostname
78 is omitted, then the target host is the local host.
79
80 port
81 The default port for communicating with the remote server. If the
82 hostname is omitted or the protocol specifies an optimized, local
83 protocol, then port is ignored. Otherwise, treatment of the port
84 parameter is implementation specific. For the default rmi proto‐
85 col, the port indicates the port number for the rmiregistry on
86 the remote host. If port is omitted, and protocol indicates rmi,
87 then the default rmiregistry port (1099) is used.
88
89 servername
90 The treatment of this parameter depends on implementation. For
91 the optimized local protocol, this field is ignored. For the rmi
92 protocol, it represents the name of the RMI remote object on the
93 remote host.
94
95
97 The jstat command supports two types of options, general options and
98 output options. General options cause jstat to display simple usage and
99 version information. Output options determine the content and format of
100 the statistical output.
101
102
103 NOTE: All options, and their functionality are subject to change or
104 removal in future releases.
105
106 GENERAL OPTIONS
107 If you specify one of the general options, you cannot specify any other
108 option or parameter.
109
110 -help
111 Display help message.
112
113 -version
114 Display version information.
115
116 -options
117 Display list of statistics options. See the Output Options sec‐
118 tion below.
119
120
121 OUTPUT OPTIONS
122 If you do not specify a general option, then you can specify output
123 options. Output options determine the content and format of jstat's
124 output, and consist of a single statOption, plus any of the other out‐
125 put options (-h, -t, and -J). The statOption must come first.
126
127 Output is formatted as a table, with columns are separated by spaces. A
128 header row with titles describes the columns. Use the -h option to set
129 the frequency at which the header is displayed. Column header names are
130 generally consistent between the different options. In general, if two
131 options provide a column with the same name, then the data source for
132 the two columns are the same.
133
134 Use the -t option to display a time stamp column, labeled Timestamp as
135 the first column of output. The Timestamp column contains the elapsed
136 time, in seconds, since startup of the target JVM. The resolution of
137 the time stamp is dependent on various factors and is subject to varia‐
138 tion due to delayed thread scheduling on heavily loaded systems.
139
140 Use the interval and count parameters to determine how frequently and
141 how many times, respectively, jstat displays its output.
142
143 NOTE: You are advised not to write scripts to parse jstat's output
144 since the format may change in future releases. If you choose to write
145 scripts that parse jstat output, expect to modify them for future
146 releases of this tool.
147
148 -statOption
149 Determines the statistics information that jstat displays. The
150 following table lists the available options. Use the -options
151 general option to display the list of options for a particular
152 platform installation.
153
154 -h n
155 Display a column header every n samples (output rows), where n is
156 a positive integer. Default value is 0, which displays the column
157 header above the first row of data.
158
159 -t n
160 Display a timestamp column as the first column of output. The
161 timestamp is the time since the start time of the target JVM.
162
163 -JjavaOption
164 Pass javaOption to the java application launcher. For example,
165 -J-Xms48m sets the startup memory to 48 megabytes. For a complete
166 list of options, see java(1)
167
168
169 STATOPTIONS AND OUTPUT
170 The following tables summarize the columns that jstat outputs for each
171 statOption.
172
173
174 -class Option
175 -compiler Option
176 -gc Option
177 -gccapacity Option
178 -gccause Option
179 This option displays the same summary of garbage collection statistics
180 as the -gcutil option, but includes the causes of the last garbage col‐
181 lection event and (if applicable) the current garbage collection event.
182 In addition to the columns listed for -gcutil, this option adds the
183 following columns:
184
185 -gcnew Option
186 -gcnewcapacity Option
187 -gcold Option
188 -gcoldcapacity Option
189 -gcpermcapacity Option
190 -gcutil Option
191 -printcompilation Option
193 This section presents some examples of monitoring a local JVM with a
194 lvmid of 21891.
195
196 Using the gcutil option
197 This example attaches to lvmid 21891 and takes 7 samples at 250 mil‐
198 lisecond intervals and displays the output as specified by the -gcutil
199 option.
200
201 jstat -gcutil 21891 250 7
202
203 S0 S1 E O P YGC YGCT FGC FGCT GCT
204
205 12.44 0.00 27.20 9.49 96.70 78 0.176 5 0.495 0.672
206
207 12.44 0.00 62.16 9.49 96.70 78 0.176 5 0.495 0.672
208
209 12.44 0.00 83.97 9.49 96.70 78 0.176 5 0.495 0.672
210
211 0.00 7.74 0.00 9.51 96.70 79 0.177 5 0.495 0.673
212
213 0.00 7.74 23.37 9.51 96.70 79 0.177 5 0.495 0.673
214
215 0.00 7.74 43.82 9.51 96.70 79 0.177 5 0.495 0.673
216
217 0.00 7.74 58.11 9.51 96.71 79 0.177 5 0.495 0.673
218
219
220
221 The output of this example shows that a young generation collection
222 occurred between the 3rd and 4th sample. The collection took 0.001 sec‐
223 onds and promoted objects from the eden space (E) to the old space (O),
224 resulting in an increase of old space utilization from 9.49% to 9.51%.
225 Before the collection, the survivor space was 12.44% utilized, but
226 after this collection it is only 7.74% utilized.
227
228 Repeating the column header string
229 This example attaches to lvmid 21891 and takes samples at 250 millisec‐
230 ond intervals and displays the output as specified by -gcutil option.
231 In addition, it uses the -h3 option to output the column header after
232 every 3 lines of data.
233
234 jstat -gcnew -h3 21891 250
235
236 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
237
238 64.0 64.0 0.0 31.7 31 31 32.0 512.0 178.6 249 0.203
239
240 64.0 64.0 0.0 31.7 31 31 32.0 512.0 355.5 249 0.203
241
242 64.0 64.0 35.4 0.0 2 31 32.0 512.0 21.9 250 0.204
243
244 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
245
246 64.0 64.0 35.4 0.0 2 31 32.0 512.0 245.9 250 0.204
247
248 64.0 64.0 35.4 0.0 2 31 32.0 512.0 421.1 250 0.204
249
250 64.0 64.0 0.0 19.0 31 31 32.0 512.0 84.4 251 0.204
251
252 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
253
254 64.0 64.0 0.0 19.0 31 31 32.0 512.0 306.7 251 0.204
255
256
257
258 In addition to showing the repeating header string, this example shows
259 that between the 2nd and 3rd samples, a young GC occurred. Its duration
260 was 0.001 seconds. The collection found enough live data that the sur‐
261 vivor space 0 utilization (S0U) would would have exceeded the desired
262 survivor Size (DSS). As a result, objects were promoted to the old gen‐
263 eration (not visible in this output), and the tenuring threshold (TT)
264 was lowered from 31 to 2.
265
266 Another collection occurs between the 5th and 6th samples. This collec‐
267 tion found very few survivors and returned the tenuring threshold to
268 31.
269
270 Including a time stamp for each sample
271 This example attaches to lvmid 21891 and takes 3 samples at 250 mil‐
272 lisecond intervals. The -t option is used to generate a time stamp for
273 each sample in the first column.
274
275 jstat -gcoldcapacity -t 21891 250 3
276
277 Timestamp OGCMN OGCMX OGC OC YGC FGC FGCT GCT
278
279 150.1 1408.0 60544.0 11696.0 11696.0 194 80 2.874 3.799
280
281 150.4 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
282
283 150.7 1408.0 60544.0 13820.0 13820.0 194 81 2.938 3.863
284
285
286
287 The Timestamp column reports the elapsed time in seconds since the
288 start of the target JVM. In addition, the -gcoldcapacity output shows
289 the old generation capacity (OGC) and the old space capacity (OC)
290 increasing as the heap expands to meet allocation and/or promotion
291 demands. The old generation capacity (OGC) has grown to from 11696 KB
292 to 13820 KB after the 81st Full GC (FGC). The maximum capacity of the
293 generation (and space) is 60544 KB (OGCMX), so it still has room to
294 expand.
295
296 Monitor instrumentation for a remote JVM
297 This example attaches to lvmid 40496 on the system named remote.domain
298 using the -gcutil option, with samples taken every second indefinitely.
299
300 jstat -gcutil 40496@remote.domain 1000
301
302
303
304
305 The lvmid is combined with the name of the remote host to construct a
306 vmid of 40496@remote.domain. This vmid results in the use of the rmi
307 protocol to communicate to the default jstatd server on the remote
308 host. The jstatd server is located using the rmiregistry on
309 remote.domain that is bound to the default rmiregistry port (port
310 1099).
311
313 o java(1) - the Java Application Launcher
314
315 o jps(1) - the Java Process Status Application
316
317 o jstatd(1) - the jvmstat daemon
318
319 o rmiregistry(1) - the Java Remote Object Registry
320
321
322 16 Mar 2012 jstat(1)