JVISUALVM is the JDK's own tool for monitoring the health of the JVM, using JVISUALVM to view the operation of the JVM, the GC situation, the running of the thread, the condition of classes and instances in memory, and so on.
Using JVISUALVM to remotely observe the Java program, the original link: http://blog.iamzsx.me/show.html?id=394002
Sometimes, we may need to remotely view the operation of a Java program on a machine, for example, a memory leak may occur, but only in a particular environment. At this point we need to remotely observe some of the Java program's implementation. JVISUALVM provides a convenient interface to help us monitor Java programs.
The first way to introduce this is to use JMX for monitoring. This approach requires us to manually turn on the JMX remote function when we start the Java program. The way to open it is to start the Java program with the following command-line arguments:
-dcom.sun.management.jmxremote.port=<port>
-dcom.sun.management.jmxremote.ssl=false
-dcom.sun.management.jmxremote.authenticate=false
Here <port> is the port used by JXM remote. You can change to the port you want.
Suppose we want to start a Java program Foo.jar on this 10.2.3.4 machine. Then we can use the following method to start the program.
java-dcom.sun.management.jmxremote.port=40124
-dcom.sun.management.jmxremote.ssl=False
-dcom.sun.management.jmxremote.authenticate=false -jar Foo.jar
Here we set the port to 40124.
Next we open JVISUALVM, then right-click on the remote, fill in the server we want to monitor host:10.2.3.4, click OK.
Use JVISUALVM to remotely observe Java programs and JVISUALVM plugins [go]