blob: 3e0cd2a19fab2578267da97438ae728d5f440713 [file] [log] [blame]
alanb0d058232012-11-02 15:50:11 +00001." Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
fparain9c21eb92012-01-04 03:49:35 -08002." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3."
4." This code is free software; you can redistribute it and/or modify it
5." under the terms of the GNU General Public License version 2 only, as
6." published by the Free Software Foundation.
7."
8." This code is distributed in the hope that it will be useful, but WITHOUT
9." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11." version 2 for more details (a copy is included in the LICENSE file that
12." accompanied this code).
13."
14." You should have received a copy of the GNU General Public License version
15." 2 along with this work; if not, write to the Free Software Foundation,
16." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17."
18." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19." or visit www.oracle.com if you need additional information or have any
20." questions.
21."
22.TH jcmd 1 "22 Novembre 2011"
23
24.LP
25.SH "Name"
26jcmd \- Diagnostic Command
27.br
28
29.LP
30.SH "SYNOPSIS"
31.LP
32.nf
33\f3
34.fl
35\fP\f3jcmd\fP [ option ]
36.fl
37\f3jcmd\fP <\fIpid\fR | \fImain class\fR> PerfCounter.print
38.fl
39\f3jcmd\fP <\fIpid\fR | \fImain class\fR> \fIcommand\fR [\fIarguments\fR]
40.fl
41\f3jcmd\fP <\fIpid\fR | \fImain class\fR> -f \fIfile\fR
42.fl
43.fl
44.fi
45
46.LP
47.SH "DESCRIPTION"
48.LP
49.LP
50\f3jcmd\fP is a utility to send diagnostic command requests to a Java
51Virtual Machine supporting this feature. Used without arguments or with the \-l option, jcmd prints the list of running Java processes with their process id, their main class and their command line arguments. When a process id is specified on the command line, jcmd sends the diagnostic command request to the process with this id. When a main class is specified on the command line, jcmd sends the diagnostic command request to all Java processes with this main class. With the PerfCounter.print argument, jcmd prints the performance counters available on the targeted Java process(es). With the \-f option, jcmd sends to the targeted Java process(es) the diagnostic commands stored in the file \fIfile\fR.
52.LP
53\fP
54.fi
55
56.SH "OPTIONS"
57.LP
58.LP
59Options are mutually exclusive. Options, if used, should follow immediately after the command name.
60.LP
61.RS 3
62.TP 3
63\-l
64prints the list of running Java processes with their process id, their
65main class and their command line arguments.
66.TP 3
67\-h
68prints a help message.
69.br
70.br
71.TP 3
72\-help
73prints a help message
74.br
75.RE
76
77.LP
78.SH "PARAMETERS"
79.LP
80.RS 3
81.TP 3
82\fIpid\fR
83Identifies the process which will receive the diagnostic command requests. The process must be a Java process. To get a list of Java processes running on a machine, jps(1) or jcmd(1) may be used.
84.RE
85.LP
86.RS 3
87.TP 3
88\fImain class\fR
89Main class of the process which will receive the diagnostic command requests. If several running Java processes share this main class, the diagnostic command request will be sent to all these processes. To get a list of Java processes running on a machine, jps(1) or jcmd(1) may be used.
90.RE
91.RS 3
92.TP 3
93\fIcommand\fR [\fIarguments\fR]
94Invoke the diagnostic command called \fIcommand\fR on the targeted Java
95process(es). The list of available diagnostic commands for a given
96process can be obtained by invoking the 'help' command on this process.
97Each diagnostic command has its own set of \fIarguments\fR which can be
98obtained by invoking the 'help' command followed by the command name.
99.RE
100.RS 3
101.TP 3
102\fIPerfCounter.print\fR
103Print the performance counters available on the targeted Java
104process(es). The list of performance counters may vary with the Java
105process.
106.RE
107.RS 3
108.TP 3
109\fI-f file\fR
110Read commands from \fIfile\fR and invoke them on the targeted Java
111process(es). In \fIfile\fR, each command must be written on a single line.
112Lines starting with # are ignored. Processing of \fIfile\fR ends when
113all lines have been invoked or when a line containing the 'stop' keyword
114is read.
115.LP
116.SH "SEE ALSO"
117.LP
118.RS 3
119.TP 2
120o
121jps(1)
122.RE
123
124