1JSTATD(1) JDK Commands JSTATD(1)
2
3
4
6 jstatd - monitor the creation and termination of instrumented Java
7 HotSpot VMs
8
10 Note: This command is experimental and unsupported.
11
12 jstatd [options]
13
14 options
15 This represents the jstatd command-line options. See Options
16 for the jstatd Command.
17
19 The jstatd command is an RMI server application that monitors for the
20 creation and termination of instrumented Java HotSpot VMs and provides
21 an interface to enable remote monitoring tools, jstat and jps, to at‐
22 tach to JVMs that are running on the local host and collect information
23 about the JVM process.
24
25 The jstatd server requires an RMI registry on the local host. The js‐
26 tatd server attempts to attach to the RMI registry on the default port,
27 or on the port you specify with the -p port option. If an RMI registry
28 is not found, then one is created within the jstatd application that's
29 bound to the port that's indicated by the -p port option or to the de‐
30 fault RMI registry port when the -p port option is omitted. You can
31 stop the creation of an internal RMI registry by specifying the -nr op‐
32 tion.
33
35 -nr This option does not attempt to create an internal RMI registry
36 within the jstatd process when an existing RMI registry isn't
37 found.
38
39 -p port
40 This option sets the port number where the RMI registry is ex‐
41 pected to be found, or when not found, created if the -nr option
42 isn't specified.
43
44 -r rmiport
45 This option sets the port number to which the RMI connector is
46 bound. If not specified a random available port is used.
47
48 -n rminame
49 This option sets the name to which the remote RMI object is
50 bound in the RMI registry. The default name is JStatRemoteHost.
51 If multiple jstatd servers are started on the same host, then
52 the name of the exported RMI object for each server can be made
53 unique by specifying this option. However, doing so requires
54 that the unique server name be included in the monitoring
55 client's hostid and vmid strings.
56
57 -Joption
58 This option passes a Java option to the JVM, where the option is
59 one of those described on the reference page for the Java appli‐
60 cation launcher. For example, -J-Xms48m sets the startup memory
61 to 48 MB. See java.
62
64 The jstatd server can monitor only JVMs for which it has the appropri‐
65 ate native access permissions. Therefore, the jstatd process must be
66 running with the same user credentials as the target JVMs. Some user
67 credentials, such as the root user in Linux and OS X operating systems,
68 have permission to access the instrumentation exported by any JVM on
69 the system. A jstatd process running with such credentials can monitor
70 any JVM on the system, but introduces additional security concerns.
71
72 The jstatd server doesn't provide any authentication of remote clients.
73 Therefore, running a jstatd server process exposes the instrumentation
74 export by all JVMs for which the jstatd process has access permissions
75 to any user on the network. This exposure might be undesirable in your
76 environment, and therefore, local security policies should be consid‐
77 ered before you start the jstatd process, particularly in production
78 environments or on networks that aren't secure.
79
80 The jstatd server installs an instance of RMISecurityPolicy when no
81 other security manager is installed, and therefore, requires a security
82 policy file to be specified. The policy file must conform to Default
83 Policy Implementation and Policy File Syntax.
84
85 If your security concerns can't be addressed with a customized policy
86 file, then the safest action is to not run the jstatd server and use
87 the jstat and jps tools locally. However, when using jps to get a list
88 of instrumented JVMs, the list will not include any JVMs running in
89 docker containers.
90
92 The interface exported by the jstatd process is proprietary and guaran‐
93 teed to change. Users and developers are discouraged from writing to
94 this interface.
95
97 The following are examples of the jstatd command. The jstatd scripts
98 automatically start the server in the background.
99
101 This example shows how to start a jstatd session with an internal RMI
102 registry. This example assumes that no other server is bound to the
103 default RMI registry port (port 1099).
104
105 jstatd -J-Djava.security.policy=all.policy
106
108 This example starts a jstatd session with an external RMI registry.
109
110 rmiregistry&
111 jstatd -J-Djava.security.policy=all.policy
112
113 This example starts a jstatd session with an external RMI registry
114 server on port 2020.
115
116 jrmiregistry 2020&
117 jstatd -J-Djava.security.policy=all.policy -p 2020
118
119 This example starts a jstatd session with an external RMI registry
120 server on port 2020 and JMX connector bound to port 2021.
121
122 jrmiregistry 2020&
123 jstatd -J-Djava.security.policy=all.policy -p 2020 -r 2021
124
125 This example starts a jstatd session with an external RMI registry on
126 port 2020 that's bound to AlternateJstatdServerName.
127
128 rmiregistry 2020&
129 jstatd -J-Djava.security.policy=all.policy -p 2020 -n AlternateJstatdServerName
130
132 This example starts a jstatd session that doesn't create an RMI reg‐
133 istry when one isn't found. This example assumes an RMI registry is
134 already running. If an RMI registry isn't running, then an error mes‐
135 sage is displayed.
136
137 jstatd -J-Djava.security.policy=all.policy -nr
138
140 This example starts a jstatd session with RMI logging capabilities en‐
141 abled. This technique is useful as a troubleshooting aid or for moni‐
142 toring server activities.
143
144 jstatd -J-Djava.security.policy=all.policy -J-Djava.rmi.serv‐
145 er.logCalls=true
146
147
148
149JDK 17 2021 JSTATD(1)