1 '\" t
   2 .\" Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
   3 .\" 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
  11 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 .\" 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
  31 .\"
  32 .if n .pl 99999
  33 .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"
  54 jcmd \- Sends diagnostic command requests to a running Java Virtual Machine (JVM)\&.
  55 .SH "SYNOPSIS"
  56 .sp
  57 .if n \{\
  58 .RS 4
  59 .\}
  60 .nf
  61 \fBjcmd\fR [\fB\-l\fR|\fB\-h\fR|\fB\-help\fR]
  62 .fi
  63 .if n \{\
  64 .RE
  65 .\}
  66 .sp
  67 .if n \{\
  68 .RS 4
  69 .\}
  70 .nf
  71 \fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fBPerfCounter\&.print\fR
  72 .fi
  73 .if n \{\
  74 .RE
  75 .\}
  76 .sp
  77 .if n \{\
  78 .RS 4
  79 .\}
  80 .nf
  81 \fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fB\-f\fR \fIfilename\fR
  82 .fi
  83 .if n \{\
  84 .RE
  85 .\}
  86 .sp
  87 .if n \{\
  88 .RS 4
  89 .\}
  90 .nf
  91 \fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fIcommand\fR[ \fIarguments\fR]
  92 .fi
  93 .if n \{\
  94 .RE
  95 .\}
  96 .SH "DESCRIPTION"
  97 .PP
  98 The
  99 \fBjcmd\fR
 100 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\&.
 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
 114 allbox tab(:);
 115 l.
 116 T{
 117 .PP
 118 To invoke diagnostic commands from a remote machine or with different identifiers, you can use the
 119 \fBcom\&.sun\&.management\&.DiagnosticCommandMBean\fR
 120 interface\&. For more information about the
 121 \fBDiagnosticCommandMBean\fR
 122 interface, see the API documentation at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
 123 T}
 124 .TE
 125 .sp 1
 126 .sp .5v
 127 .RE
 128 .PP
 129 If you run
 130 \fBjcmd\fR
 131 without arguments or with the
 132 \fB\-l\fR
 133 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
 134 \fBjcmd\fR
 135 with the
 136 \fB\-h\fR
 137 or
 138 \fB\-help\fR
 139 option prints the tool\(cqs help message\&.
 140 .PP
 141 If you specify the processes identifier (\fIpid\fR) or the main class (\fImain\-class\fR) as the first argument,
 142 \fBjcmd\fR
 143 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
 144 \fB0\fR
 145 as the process identifier\&. Use one of the following as the diagnostic command request:
 146 .PP
 147 Perfcounter\&.print
 148 .RS 4
 149 Prints the performance counters available for the specified Java process\&. The list of performance counters might vary with the Java process\&.
 150 .RE
 151 .PP
 152 \-f \fIfilename\fR
 153 .RS 4
 154 The 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
 156 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
 157 \fBstop\fR
 158 keyword is read\&.
 159 .RE
 160 .PP
 161 \fIcommand\fR [\fIarguments\fR]
 162 .RS 4
 163 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
 164 \fBhelp\fR
 165 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
 166 \fBhelp\fR
 167 command\&.
 168 .sp
 169 \fBNote:\fR
 170 If any arguments contain spaces, you must surround them with single or double quotation marks (\fB\*(Aq\fR
 171 or
 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
 176 Options are mutually exclusive\&.
 177 .PP
 178 \-f \fIfilename\fR
 179 .RS 4
 180 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
 181 \fBstop\fR
 182 keyword is read\&.
 183 .RE
 184 .PP
 185 \-h
 186 .br
 187 \-help
 188 .RS 4
 189 Prints a help message\&.
 190 .RE
 191 .PP
 192 \-l
 193 .RS 4
 194 Prints 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 .\}
 206 jps(1)
 207 .RE
 208 .br
 209 'pl 8.5i
 210 'bp