blob: 79b8b392fd6f2a19c8f79b3112b94f15fe234f88 [file] [log] [blame]
bpatel87d64cc2010-07-14 15:42:06 -07001." Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
duke6e45e102007-12-01 00:00:00 +00002." 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."
ohair2283b9d2010-05-25 15:58:33 -070018." 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.
tbell16c34dd2009-05-04 18:28:26 -070021."
bpatel87d64cc2010-07-14 15:42:06 -070022.TH jstatd 1 "02 Jun 2010"
duke6e45e102007-12-01 00:00:00 +000023
24.LP
tbell16c34dd2009-05-04 18:28:26 -070025.SH "Name"
duke6e45e102007-12-01 00:00:00 +000026jstatd \- Virtual Machine jstat Daemon
27.LP
28.SH "SYNOPSIS"
29.LP
30
31.LP
32.nf
33\f3
34.fl
35jstatd [ \fP\f4options\fP\f3 ]\fP
36.br
37\f3
38.fl
39\fP
40.fi
41
42.LP
43.SH "PARAMETERS"
44.LP
45
46.LP
tbell16c34dd2009-05-04 18:28:26 -070047.RS 3
duke6e45e102007-12-01 00:00:00 +000048.TP 3
49options
50Command\-line options. The options may be in any order. If there are redundant or contradictory options, the last option specified will take precedence.
tbell16c34dd2009-05-04 18:28:26 -070051.RE
52
duke6e45e102007-12-01 00:00:00 +000053.LP
54.SH "DESCRIPTION"
55.LP
56
57.LP
58.LP
59The \f3jstatd\fP tool is an RMI server application that monitors for the creation and termination of instrumented HotSpot Java virtual machines (JVMs) and provides a interface to allow remote monitoring tools to attach to JVMs running on the local host.
60.LP
61.LP
62The \f3jstatd\fP server requires the presence of an RMI registry on the local host. The \f3jstatd\fP server will attempt to attach to the RMI registry on the default port, or on the port indicated by the \f2\-p port\fP option. If an RMI registry is not found, one will be created within the \f3jstatd\fP application bound to the port indicated by the \f2\-p port\fP option or to the default RMI registry port if \f2\-p port\fP is omitted. Creation of an internal RMI registry can be inhibited by specifying the \f2\-nr\fP option.
63.LP
64.LP
65\f3NOTE:\fP This utility is unsupported and may or may not be available in future versions of the JDK. It is not currently available on the Windows 98 and Windows ME platforms.
66.LP
67.SH "OPTIONS"
68.LP
69
70.LP
71.LP
72The \f3jstatd\fP command supports the following options:
73.LP
tbell16c34dd2009-05-04 18:28:26 -070074.RS 3
duke6e45e102007-12-01 00:00:00 +000075.TP 3
76\-nr
77Do not attempt to create an internal RMI registry within the \f2jstatd\fP process when an existing RMI registry is not found.
78.TP 3
79\-p\ port
80Port number where the RMI registry is expected to be found, or, if not found, created if \f2\-nr\fP is not specified.
81.TP 3
82\-n\ rminame
tbell16c34dd2009-05-04 18:28:26 -070083Name to which the remote RMI object is bound in the RMI registry. The default name is \f2JStatRemoteHost\fP. If multiple \f3jstatd\fP servers are started on the same host, the name of the exported RMI object for each server can be made unique by specifying this option. However, doing so will require that the unique server name be included in the monitoring client's \f2hostid\fP and \f2vmid\fP strings.
duke6e45e102007-12-01 00:00:00 +000084.TP 3
85\-Joption
86Pass \f2option\fP to the \f3java\fP launcher called by \f3javac\fP. For example, \f3\-J\-Xms48m\fP sets the startup memory to 48 megabytes. It is a common convention for \f3\-J\fP to pass options to the underlying VM executing applications written in Java.
tbell16c34dd2009-05-04 18:28:26 -070087.RE
88
duke6e45e102007-12-01 00:00:00 +000089.LP
90.SH "SECURITY"
91.LP
92
93.LP
94.LP
95The \f3jstatd\fP server can only monitor JVMs for which it has the appropriate native access permissions. Therefor the \f3jstatd\fP process must be running with the same user credentials as the target JVMs. Some user credentials, such as the \f2root\fP user in UNIX(TM) based systems, have permission to access the instrumentation exported by any JVM on the system. A \f3jstatd\fP process running with such credentials can monitor any JVM on the system, but introduces additional security concerns.
96.LP
97.LP
98The \f3jstatd\fP server does not provide any authentication of remote clients. Therefore, running a \f3jstatd\fP server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fP process has access permissions to any user on the network. This exposure may be undesireable in your environment and local security policies should be considered before starting the \f3jstatd\fP process, particularly in production environments or on unsecure networks.
99.LP
100.LP
101The \f3jstatd\fP server installs an instance of RMISecurityPolicy if no other security manager has been installed and therefore requires a security policy file to be specified. The policy file must conform to the default policy implementation's
102.na
103\f2Policy File Syntax\fP @
104.fi
105http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html.
106.LP
107.LP
108The following policy file will allow the \f3jstatd\fP server to run without any security exceptions. This policy is less liberal then granting all permissions to all codebases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fP server.
109.LP
110.nf
111\f3
112.fl
113grant codebase "file:${java.home}/../lib/tools.jar" {\fP
114.br
115\f3
116.fl
117 permission java.security.AllPermission;\fP
118.br
119\f3
120.fl
121};\fP
122.br
123\f3
124.fl
125\fP
126.fi
127
128.LP
129.LP
130To use this policy, copy the text into a file called \f2jstatd.all.policy\fP and run the \f3jstatd\fP server as follows:
131.LP
132.nf
133\f3
134.fl
135jstatd \-J\-Djava.security.policy=jstatd.all.policy\fP
136.br
137\f3
138.fl
139\fP
140.fi
141
142.LP
143.LP
144For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP addreess spoofing attacks. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fP server and use the \f3jstat\fP and \f3jps\fP tools locally.
145.LP
tbell16c34dd2009-05-04 18:28:26 -0700146.SH "REMOTE INTERFACE"
duke6e45e102007-12-01 00:00:00 +0000147.LP
148
149.LP
150.LP
151The interface exported by the \f3jstatd\fP process is proprietary and is guaranteed to change. Users and developers are discouraged from writing to this interface.
152.LP
153.SH "EXAMPLES"
154.LP
155
156.LP
157.LP
158Here are some examples of starting \f3jstatd\fP. Note that the \f3jstatd\fP scripts automatically start the server in the background.
159.LP
160.SS
tbell16c34dd2009-05-04 18:28:26 -0700161Using Internal RMI Registry
duke6e45e102007-12-01 00:00:00 +0000162.LP
163.LP
164This example demonstrates starting \f3jstatd\fP with an internal RMI registry. This example assumes that no other server is bound to the default RMI Registry port (port 1099).
165.LP
166.nf
167\f3
168.fl
169jstatd \-J\-Djava.security.policy=all.policy
170.fl
171\fP
172.fi
173
174.LP
175.SS
tbell16c34dd2009-05-04 18:28:26 -0700176Using External RMI Registry
duke6e45e102007-12-01 00:00:00 +0000177.LP
178.LP
179This example demonstrates starting \f3jstatd\fP with a external RMI registry.
180.LP
181.nf
182\f3
183.fl
184rmiregistry&
185.fl
186jstatd \-J\-Djava.security.policy=all.policy
187.fl
188\fP
189.fi
190
191.LP
192.LP
193This example demonstrates starting \f3jstatd\fP with an external RMI registry server on port 2020.
194.LP
195.nf
196\f3
197.fl
198rmiregistry 2020&
199.fl
200jstatd \-J\-Djava.security.policy=all.policy \-p 2020
201.fl
202\fP
203.fi
204
205.LP
206.LP
207This example demonstrates starting \f3jstatd\fP with an external RMI registry on port 2020, bound to name AlternateJstatdServerName.
208.LP
209.nf
210\f3
211.fl
212rmiregistry 2020&
213.fl
214jstatd \-J\-Djava.security.policy=all.policy \-p 2020 \-n AlternateJstatdServerName
215.fl
216\fP
217.fi
218
219.LP
220.SS
tbell16c34dd2009-05-04 18:28:26 -0700221Inhibiting creation of an in\-process RMI registry
duke6e45e102007-12-01 00:00:00 +0000222.LP
223.LP
224This example demonstrates starting \f3jstatd\fP such that it will not create a RMI registry if one is not found. This example assumes an RMI registry is already running. If it is not, an appropriate error message is emitted.
225.LP
226.nf
227\f3
228.fl
229jstatd \-J\-Djava.security.policy=all.policy \-nr
230.fl
231\fP
232.fi
233
234.LP
235.SS
tbell16c34dd2009-05-04 18:28:26 -0700236Enabling RMI logging capabilities.
duke6e45e102007-12-01 00:00:00 +0000237.LP
238.LP
239This example demonstrates starting \f3jstatd\fP with RMI logging capabilities enabled. This technique is useful as a troubleshooting aid or for monitoring server activities.
240.LP
241.nf
242\f3
243.fl
244jstatd \-J\-Djava.security.policy=all.policy \-J\-Djava.rmi.server.logCalls=true
245.fl
246\fP
247.fi
248
249.LP
250.SH "SEE ALSO"
251.LP
252.RS 3
253.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700254o
255java(1) \- the Java Application Launcher
duke6e45e102007-12-01 00:00:00 +0000256.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700257o
258jps(1) \- the Java Process Status Application
duke6e45e102007-12-01 00:00:00 +0000259.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700260o
261jstat(1) \- the Java Virtual Machine Statistics Monitoring Tool
duke6e45e102007-12-01 00:00:00 +0000262.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700263o
264.na
265\f2rmiregistry\fP @
266.fi
267http://java.sun.com/javase/6/docs/technotes/tools/index.html#rmi \- the Java Remote Object Registry
duke6e45e102007-12-01 00:00:00 +0000268.RE
269
270.LP
duke6e45e102007-12-01 00:00:00 +0000271