1jstatd(1) General Commands Manual jstatd(1)
2
3
4
6 jstatd - Virtual Machine jstat Daemon
7
9 jstatd [ options ]
10
11
13 options
14 Command-line options. The options may be in any order. If there
15 are redundant or contradictory options, the last option specified
16 will take precedence.
17
18
20 The jstatd tool is an RMI server application that monitors for the cre‐
21 ation and termination of instrumented HotSpot Java virtual machines
22 (JVMs) and provides a interface to allow remote monitoring tools to
23 attach to JVMs running on the local host.
24
25 The jstatd server requires the presence of an RMI registry on the local
26 host. The jstatd server will attempt to attach to the RMI registry on
27 the default port, or on the port indicated by the -p port option. If an
28 RMI registry is not found, one will be created within the jstatd appli‐
29 cation bound to the port indicated by the -p port option or to the
30 default RMI registry port if -p port is omitted. Creation of an inter‐
31 nal RMI registry can be inhibited by specifying the -nr option.
32
33 NOTE: This utility is unsupported and may or may not be available in
34 future versions of the JDK. It is not currently available on the Win‐
35 dows 98 and Windows ME platforms.
36
38 The jstatd command supports the following options:
39
40 -nr
41 Do not attempt to create an internal RMI registry within the
42 jstatd process when an existing RMI registry is not found.
43
44 -p port
45 Port number where the RMI registry is expected to be found, or,
46 if not found, created if -nr is not specified.
47
48 -n rminame
49 Name to which the remote RMI object is bound in the RMI registry.
50 The default name is JStatRemoteHost. If multiple jstatd servers
51 are started on the same host, the name of the exported RMI object
52 for each server can be made unique by specifying this option.
53 However, doing so will require that the unique server name be
54 included in the monitoring client's hostid and vmid strings.
55
56 -Joption
57 Pass option to the java launcher called by javac. For example,
58 -J-Xms48m sets the startup memory to 48 megabytes. It is a common
59 convention for -J to pass options to the underlying VM executing
60 applications written in Java.
61
62
64 The jstatd server can only monitor JVMs for which it has the appropri‐
65 ate native access permissions. Therefor the jstatd process must be run‐
66 ning with the same user credentials as the target JVMs. Some user cre‐
67 dentials, such as the root user in UNIX(TM) based systems, have permis‐
68 sion to access the instrumentation exported by any JVM on the system. A
69 jstatd process running with such credentials can monitor any JVM on the
70 system, but introduces additional security concerns.
71
72 The jstatd server does not provide any authentication of remote
73 clients. Therefore, running a jstatd server process exposes the instru‐
74 mentation export by all JVMs for which the jstatd process has access
75 permissions to any user on the network. This exposure may be undesire‐
76 able in your environment and local security policies should be consid‐
77 ered before starting the jstatd process, particularly in production
78 environments or on unsecure networks.
79
80 The jstatd server installs an instance of RMISecurityPolicy if no other
81 security manager has been installed and therefore requires a security
82 policy file to be specified. The policy file must conform to the
83 default policy implementation's Policy File Syntax @
84 http://docs.oracle.com/javase/7/docs/technotes/guides/security/Policy‐
85 Files.html.
86
87 The following policy file will allow the jstatd server to run without
88 any security exceptions. This policy is less liberal then granting all
89 permissions to all codebases, but is more liberal than a policy that
90 grants the minimal permissions to run the jstatd server.
91
92 grant codebase "file:${java.home}/../lib/tools.jar" {
93 permission java.security.AllPermission;
94 };
95
96
97 To use this policy, copy the text into a file called jstatd.all.policy
98 and run the jstatd server as follows:
99
100 jstatd -J-Djava.security.policy=jstatd.all.policy
101
102
103 For sites with more restrictive security practices, it is possible to
104 use a custom policy file to limit access to specific trusted hosts or
105 networks, though such techniques are subject to IP addreess spoofing
106 attacks. If your security concerns cannot be addressed with a custom‐
107 ized policy file, then the safest action is to not run the jstatd
108 server and use the jstat and jps tools locally.
109
111 The interface exported by the jstatd process is proprietary and is
112 guaranteed to change. Users and developers are discouraged from writing
113 to this interface.
114
116 Here are some examples of starting jstatd. Note that the jstatd scripts
117 automatically start the server in the background.
118
119 Using Internal RMI Registry
120 This example demonstrates starting jstatd with an internal RMI reg‐
121 istry. This example assumes that no other server is bound to the
122 default RMI Registry port (port 1099).
123
124 jstatd -J-Djava.security.policy=all.policy
125
126
127 Using External RMI Registry
128 This example demonstrates starting jstatd with a external RMI registry.
129
130 rmiregistry&
131 jstatd -J-Djava.security.policy=all.policy
132
133
134 This example demonstrates starting jstatd with an external RMI registry
135 server on port 2020.
136
137 rmiregistry 2020&
138 jstatd -J-Djava.security.policy=all.policy -p 2020
139
140
141 This example demonstrates starting jstatd with an external RMI registry
142 on port 2020, bound to name AlternateJstatdServerName.
143
144 rmiregistry 2020&
145 jstatd -J-Djava.security.policy=all.policy -p 2020 -n AlternateJstatdServerName
146
147
148 Inhibiting creation of an in-process RMI registry
149 This example demonstrates starting jstatd such that it will not create
150 a RMI registry if one is not found. This example assumes an RMI reg‐
151 istry is already running. If it is not, an appropriate error message is
152 emitted.
153
154 jstatd -J-Djava.security.policy=all.policy -nr
155
156
157 Enabling RMI logging capabilities.
158 This example demonstrates starting jstatd with RMI logging capabilities
159 enabled. This technique is useful as a troubleshooting aid or for moni‐
160 toring server activities.
161
162 jstatd -J-Djava.security.policy=all.policy -J-Djava.rmi.server.logCalls=true
163
164
166 o java(1) - the Java Application Launcher
167
168 o jps(1) - the Java Process Status Application
169
170 o jstat(1) - the Java Virtual Machine Statistics Monitoring Tool
171
172 o rmiregistry @
173 http://docs.oracle.com/javase/7/docs/tech‐
174 notes/tools/index.html#rmi - the Java Remote Object Registry
175
176
177 16 Mar 2012 jstatd(1)