Virtual VM is the JDK6 Update7 tool, there is a tendency to assemble other JDK tools, the current version of JDK7 has supported most of the monitoring capabilities, as if not as Jprofile and Youkit to support real-time tracking memory stack to locate the memory leak problem.
For remotely applied connections, Virtual VMS provide two ways: Jmx and JSTATD, and the configuration of these two connections is described below.
Jmx:
Locate the Jmxremote.password.template file under Jre/lib/management in the JDK directory on the remote server, and then copy it to the file that Pwd.file points to (for example, CP./ JMXREMOTE.PASSWORD.TEMPLATE/JMX/JMX.PWD), add the username and password in the last line of the Jmx.pwd file, in the format: username password
such as: Jmx JMX
Adding JVM Parameters
Java_options= "${java_options}-dcom.sun.management.jmxremote.port=6789"
Java_options= "${java_options}-dcom.sun.management.jmxremote.pwd.file=/jmx/jmx.pwd"
Java_options= "${java_options}-dcom.sun.management.jmxremote.ssl=false"
Java_options= "${java_options}-dcom.sun.management.jmxremote.authenticate=false"
Finally, after restarting the remote server application, you can connect using the Java VIRTUALVM.
JSTATD:
Create a Java.policy file on the remote server, such as:
/tmp/jstatd.java.policy
Grant codebase "file:${java.home}/. /lib/tools.jar "{
permission java.security.AllPermission;
};
To start the JSTATD process on a remote server:
Jstatd-j-djava.security.policy=/tmp/jstatd.java.policy-j-djava.rmi.server.logcalls=true
You can then connect with the Java VIRTUALVM on the client.
Source: http://stevex.blog.51cto.com/4300375/771990