VisualVM uses Jstatd to remotely monitor the server
Jstat can display class loading, memory, garbage collection, JIT compilation and other data in local or remote JVM processes in real time. To display remote JVM information, you must enable RMI on the remote host. For details, see the following section.
1. Create the jstatd server authorization file jstatd. all. policy. The Code is as follows, and then place the file to the Java/bin directory.
Grant codebase "file: $ {java. home}/../lib/tools. jar "{
Permission java. security. AllPermission;
};
2. Switch to the java/bin directory and start the Jstatd server.
./Jstatd-J-Djava.security.policy = jstatd. all. policy
3. In case of port occupation problems, select another port when starting the jstatd server.
// Check whether the port is in use
Netstat-ano | grep-I 1099
// Specify other ports when starting the jstatd Server
Rmiregistry 2030 & jstatd-J-Djava.security.policy = jstatd. all. policy-p 2030
4. After the jstatd server is successfully started, the Jstatd server address is added to the VisualVM, and the connection succeeds automatically, and the server's CPU, memory, thread, and other information are obtained.
5. For details about Jstatd, click here.
This article permanently updates the link address: