Java virtual machine monitor configuration jvisualvm

Configuring JMX remote connections

1. Start configuration parameters

When you start jar, add the following configuration-Dcom.sun.management.jmxremote.port=5050 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=192.168.94.23

Start Parameter Description

  1. -Dcom.sun.management.jmxremote.port: Configuring a remote server on unoccupied port
  2. -Dcom.sun.management.jmxremote.ssl=false: Configuring JMX whether ssl enabled
  3. -Dcom.sun.management.jmxremote.authenticate=false: Configure whether to start authentication JXM
  4. -Djava.rmi.server.hostname: Configure the server IP

2. Configure jvisualvm

Adding remote host information, fill in the host name, port. Port is the top port startup parameter configuration.
Add Remote Host

Add JXM connection, click OK.
Add JXM connection
After successfully added, you can start a virtual machine monitor.

Note: JMX does not support viewing visual GC, jstatd need to monitor.

Configuring remote connection jstatd

1. Create a file jstatd.all.policy

grant codebase "file:/usr/local/jdk1.8.0_161/lib/tools.jar" {  
   permission java.security.AllPermission;  
}; 

2. Start jstatd

jstatd -J-Djava.security.policy=jstatd.all.policy -J-Djava.rmi.server.hostname=192.168.94.23 -J-Djava.rmi.server.logCalls=true -J-Djava.net.preferIPv4Stack=true -p 5056

Start Parameter Description

  1. -J-Djava.security.policy=jstatd.all.policy Specify the file path jstatd.all.policy
  2. -J-Djava.rmi.server.logCalls=true: Whether to print the log
  3. -J-Djava.rmi.server.hostname=192.168.19.114: Configuration server address
  4. -p: Port

3. Configure jvisualvm

Select the remote server, add jstatd right connection, fill in a port number, the port number to start jstatd above the specified port.
Add jstatd connection

After successfully added, the server will show the list of all the applications on the Java virtual machine server. Depending on the application name or port number to select the monitored service to start monitoring. At this page you can find visual GC has been viewed.

Guess you like

Origin www.cnblogs.com/bigshark/p/11257388.html