VisualVM is a tool used to monitor Java Virtual Machines and provide a lightweight profiling capability. From time to time, developers may need to monitor JVMs running at a remote host. VisualVM can be used in conjunction with jstatd to accomplish this task.
jstatd uses the Java remote object registry. This diagram shows the basic architecture at a high-level:
Step 1: get jstatd running.
If jstatd is not running, create a file called jstatd.all.policy with the following contents:
grant codebase "file:${java.home}/../lib/tools.jar" { permission java.security.AllPermission;};
Start jstatd as follows:
nohup jstatd -J-Djava.security.policy=/path/to/your/jstatd.all.policy &
Step 2: configure VisualVM.
Add the remote host to the VisualVM configuration:
The JVMs on the remote host should show up now: