jcmd.1 6.5 KB
Newer Older
R
rgallard 已提交
1
'\" t
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
.\" Copyright (c) 2012, 2015, 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.
.\"
.\" Title: jcmd
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Troubleshooting Tools
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
R
rgallard 已提交
31 32
.\"
.if n .pl 99999
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
.TH "jcmd" "1" "03 March 2015" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
R
rgallard 已提交
54
jcmd \- Sends diagnostic command requests to a running Java Virtual Machine (JVM)\&.
55 56 57 58 59 60
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.nf
R
rgallard 已提交
61
\fBjcmd\fR [\fB\-l\fR|\fB\-h\fR|\fB\-help\fR]
62 63 64 65 66 67 68 69 70
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
R
rgallard 已提交
71
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fBPerfCounter\&.print\fR
72 73 74 75 76 77 78 79 80
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
R
rgallard 已提交
81
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fB\-f\fR \fIfilename\fR
82 83 84 85 86 87 88 89 90
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
R
rgallard 已提交
91
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fIcommand\fR[ \fIarguments\fR]
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
.fi
.if n \{\
.RE
.\}
.SH "DESCRIPTION"
.PP
The
\fBjcmd\fR
utility 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\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.TS
allbox tab(:);
l.
T{
.PP
To invoke diagnostic commands from a remote machine or with different identifiers, you can use the
\fBcom\&.sun\&.management\&.DiagnosticCommandMBean\fR
interface\&. For more information about the
\fBDiagnosticCommandMBean\fR
interface, see the API documentation at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
T}
.TE
.sp 1
.sp .5v
.RE
R
rgallard 已提交
128
.PP
129 130 131 132 133 134 135 136 137 138 139
If you run
\fBjcmd\fR
without arguments or with the
\fB\-l\fR
option, 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
\fBjcmd\fR
with the
\fB\-h\fR
or
\fB\-help\fR
option prints the tool\(cqs help message\&.
R
rgallard 已提交
140
.PP
141 142 143 144 145
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain\-class\fR) as the first argument,
\fBjcmd\fR
sends 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
\fB0\fR
as the process identifier\&. Use one of the following as the diagnostic command request:
R
rgallard 已提交
146 147
.PP
Perfcounter\&.print
148
.RS 4
R
rgallard 已提交
149
Prints the performance counters available for the specified Java process\&. The list of performance counters might vary with the Java process\&.
150 151 152 153 154 155 156 157 158 159 160
.RE
.PP
\-f \fIfilename\fR
.RS 4
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the
\fB\-f\fR
option\&. 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
\fBstop\fR
keyword is read\&.
.RE
.PP
161
\fIcommand\fR [\fIarguments\fR]
162 163 164 165 166 167 168 169 170 171 172 173 174 175
.RS 4
The 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
\fBhelp\fR
command 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
\fBhelp\fR
command\&.
.sp
\fBNote:\fR
If any arguments contain spaces, you must surround them with single or double quotation marks (\fB\*(Aq\fR
or
\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)\&.
.RE
.SH "OPTIONS"
.PP
R
rgallard 已提交
176
Options are mutually exclusive\&.
177 178 179 180 181 182 183 184 185
.PP
\-f \fIfilename\fR
.RS 4
Reads 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
\fBstop\fR
keyword is read\&.
.RE
.PP
\-h
R
rgallard 已提交
186
.br
187 188
\-help
.RS 4
R
rgallard 已提交
189
Prints a help message\&.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
.RE
.PP
\-l
.RS 4
Prints the list of running Java processes identifiers with the main class and command\-line arguments\&.
.RE
.SH "SEE ALSO"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
R
rgallard 已提交
206
jps(1)
207 208 209 210
.RE
.br
'pl 8.5i
'bp