1JSTATD(1)                        JDK Commands                        JSTATD(1)
2
3
4

NAME

6       jstatd  -  monitor  the  creation  and termination of instrumented Java
7       HotSpot VMs
8

SYNOPSIS

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

DESCRIPTION

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

OPTIONS FOR THE JSTATD COMMAND

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

SECURITY

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       For security purposes, the jstatd server uses an RMI  ObjectInputFilter
81       to allow only essential classes to be deserialized.
82
83       If your security concerns can't be addressed, then the safest action is
84       to not run the jstatd server and use the jstat and jps  tools  locally.
85       However,  when  using  jps to get a list of instrumented JVMs, the list
86       will not include any JVMs running in docker containers.
87

REMOTE INTERFACE

89       The interface exported by the jstatd process is proprietary and guaran‐
90       teed  to  change.  Users and developers are discouraged from writing to
91       this interface.
92

EXAMPLES

94       The following are examples of the jstatd command.  The  jstatd  scripts
95       automatically start the server in the background.
96

INTERNAL RMI REGISTRY

98       This  example  shows how to start a jstatd session with an internal RMI
99       registry.  This example assumes that no other server is  bound  to  the
100       default RMI registry port (port 1099).
101
102              jstatd
103

EXTERNAL RMI REGISTRY

105       This example starts a jstatd session with an external RMI registry.
106
107              rmiregistry&
108              jstatd
109
110       This  example  starts  a  jstatd  session with an external RMI registry
111       server on port 2020.
112
113              jrmiregistry 2020&
114              jstatd -p 2020
115
116       This example starts a jstatd session  with  an  external  RMI  registry
117       server on port 2020 and JMX connector bound to port 2021.
118
119              jrmiregistry 2020&
120              jstatd -p 2020 -r 2021
121
122       This  example  starts a jstatd session with an external RMI registry on
123       port 2020 that's bound to AlternateJstatdServerName.
124
125              rmiregistry 2020&
126              jstatd -p 2020 -n AlternateJstatdServerName
127

STOP THE CREATION OF AN IN-PROCESS RMI REGISTRY

129       This example starts a jstatd session that doesn't create  an  RMI  reg‐
130       istry  when  one  isn't found.  This example assumes an RMI registry is
131       already running.  If an RMI registry isn't running, then an error  mes‐
132       sage is displayed.
133
134              jstatd -nr
135

ENABLE RMI LOGGING

137       This  example starts a jstatd session with RMI logging capabilities en‐
138       abled.  This technique is useful as a troubleshooting aid or for  moni‐
139       toring server activities.
140
141              jstatd -J-Djava.rmi.server.logCalls=true
142
143
144
145JDK 19                               2022                            JSTATD(1)
Impressum