blob: 88f8f2e8c97fa5cb4daff389fbd66c5f25675755 [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
rgallardf71f2512015-02-02 10:12:21 -08002.\" Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
rgallardf71f2512015-02-02 10:12:21 -08003.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4.\"
5.\" This code is free software; you can redistribute it and/or modify it
6.\" under the terms of the GNU General Public License version 2 only, as
7.\" published by the Free Software Foundation.
8.\"
9.\" This code is distributed in the hope that it will be useful, but WITHOUT
10.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mfangf2cf0062015-07-15 12:12:46 -070011.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
rgallardf71f2512015-02-02 10:12:21 -080012.\" version 2 for more details (a copy is included in the LICENSE file that
13.\" accompanied this code).
14.\"
15.\" You should have received a copy of the GNU General Public License version
16.\" 2 along with this work; if not, write to the Free Software Foundation,
17.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18.\"
19.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20.\" or visit www.oracle.com if you need additional information or have any
21.\" questions.
22.\"
23.\" Title: jcmd
24.\" Language: English
25.\" Date: 03 March 2015
26.\" SectDesc: Troubleshooting Tools
27.\" Software: JDK 8
28.\" Arch: generic
29.\" Part Number: E38207-04
30.\" Doc ID: JSSON
rgallardb6435452013-11-25 20:19:02 -080031.\"
32.if n .pl 99999
rgallardf71f2512015-02-02 10:12:21 -080033.TH "jcmd" "1" "03 March 2015" "JDK 8" "Troubleshooting Tools"
34.\" -----------------------------------------------------------------
35.\" * Define some portability stuff
36.\" -----------------------------------------------------------------
37.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38.\" http://bugs.debian.org/507673
39.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
40.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41.ie \n(.g .ds Aq \(aq
42.el .ds Aq '
43.\" -----------------------------------------------------------------
44.\" * set default formatting
45.\" -----------------------------------------------------------------
46.\" disable hyphenation
47.nh
48.\" disable justification (adjust text to left margin only)
49.ad l
50.\" -----------------------------------------------------------------
51.\" * MAIN CONTENT STARTS HERE *
52.\" -----------------------------------------------------------------
53.SH "NAME"
rgallardb6435452013-11-25 20:19:02 -080054jcmd \- Sends diagnostic command requests to a running Java Virtual Machine (JVM)\&.
rgallardf71f2512015-02-02 10:12:21 -080055.SH "SYNOPSIS"
56.sp
57.if n \{\
58.RS 4
59.\}
60.nf
rgallardb6435452013-11-25 20:19:02 -080061\fBjcmd\fR [\fB\-l\fR|\fB\-h\fR|\fB\-help\fR]
rgallardf71f2512015-02-02 10:12:21 -080062.fi
63.if n \{\
64.RE
65.\}
66.sp
67.if n \{\
68.RS 4
69.\}
70.nf
rgallardb6435452013-11-25 20:19:02 -080071\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fBPerfCounter\&.print\fR
rgallardf71f2512015-02-02 10:12:21 -080072.fi
73.if n \{\
74.RE
75.\}
76.sp
77.if n \{\
78.RS 4
79.\}
80.nf
rgallardb6435452013-11-25 20:19:02 -080081\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fB\-f\fR \fIfilename\fR
rgallardf71f2512015-02-02 10:12:21 -080082.fi
83.if n \{\
84.RE
85.\}
86.sp
87.if n \{\
88.RS 4
89.\}
90.nf
rgallardb6435452013-11-25 20:19:02 -080091\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fIcommand\fR[ \fIarguments\fR]
rgallardf71f2512015-02-02 10:12:21 -080092.fi
93.if n \{\
94.RE
95.\}
96.SH "DESCRIPTION"
rgallardb6435452013-11-25 20:19:02 -080097.PP
rgallardf71f2512015-02-02 10:12:21 -080098The
99\fBjcmd\fR
100utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
101.if n \{\
102.sp
103.\}
104.RS 4
105.it 1 an-trap
106.nr an-no-space-flag 1
107.nr an-break-flag 1
108.br
109.ps +1
110\fBNote\fR
111.ps -1
112.br
113.TS
114allbox tab(:);
115l.
116T{
rgallardb6435452013-11-25 20:19:02 -0800117.PP
rgallardf71f2512015-02-02 10:12:21 -0800118To invoke diagnostic commands from a remote machine or with different identifiers, you can use the
119\fBcom\&.sun\&.management\&.DiagnosticCommandMBean\fR
120interface\&. For more information about the
121\fBDiagnosticCommandMBean\fR
122interface, see the API documentation at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
123T}
124.TE
125.sp 1
126.sp .5v
127.RE
rgallardb6435452013-11-25 20:19:02 -0800128.PP
rgallardf71f2512015-02-02 10:12:21 -0800129If you run
130\fBjcmd\fR
131without arguments or with the
132\fB\-l\fR
133option, it prints the list of running Java process identifiers with the main class and command\-line arguments that were used to launch the process\&. Running
134\fBjcmd\fR
135with the
136\fB\-h\fR
137or
138\fB\-help\fR
139option prints the tool\(cqs help message\&.
140.PP
141If you specify the processes identifier (\fIpid\fR) or the main class (\fImain\-class\fR) as the first argument,
142\fBjcmd\fR
143sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying
144\fB0\fR
145as the process identifier\&. Use one of the following as the diagnostic command request:
146.PP
rgallardb6435452013-11-25 20:19:02 -0800147Perfcounter\&.print
rgallardf71f2512015-02-02 10:12:21 -0800148.RS 4
rgallardb6435452013-11-25 20:19:02 -0800149Prints the performance counters available for the specified Java process\&. The list of performance counters might vary with the Java process\&.
rgallardf71f2512015-02-02 10:12:21 -0800150.RE
151.PP
152\-f \fIfilename\fR
153.RS 4
154The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the
155\fB\-f\fR
156option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
157\fBstop\fR
158keyword is read\&.
159.RE
160.PP
fparain9c21eb92012-01-04 03:49:35 -0800161\fIcommand\fR [\fIarguments\fR]
rgallardf71f2512015-02-02 10:12:21 -0800162.RS 4
163The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the
164\fBhelp\fR
165command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the
166\fBhelp\fR
167command\&.
168.sp
169\fBNote:\fR
170If any arguments contain spaces, you must surround them with single or double quotation marks (\fB\*(Aq\fR
171or
172\fB"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\fB\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
173.RE
174.SH "OPTIONS"
175.PP
rgallardb6435452013-11-25 20:19:02 -0800176Options are mutually exclusive\&.
rgallardf71f2512015-02-02 10:12:21 -0800177.PP
178\-f \fIfilename\fR
179.RS 4
180Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
181\fBstop\fR
182keyword is read\&.
183.RE
184.PP
185\-h
rgallardb6435452013-11-25 20:19:02 -0800186.br
rgallardf71f2512015-02-02 10:12:21 -0800187\-help
188.RS 4
rgallardb6435452013-11-25 20:19:02 -0800189Prints a help message\&.
rgallardf71f2512015-02-02 10:12:21 -0800190.RE
191.PP
192\-l
193.RS 4
194Prints the list of running Java processes identifiers with the main class and command\-line arguments\&.
195.RE
196.SH "SEE ALSO"
197.sp
198.RS 4
199.ie n \{\
200\h'-04'\(bu\h'+03'\c
201.\}
202.el \{\
203.sp -1
204.IP \(bu 2.3
205.\}
rgallardb6435452013-11-25 20:19:02 -0800206jps(1)
rgallardf71f2512015-02-02 10:12:21 -0800207.RE
208.br
209'pl 8.5i
210'bp