Java program GC mechanism and performance stability tuning analysis

1. JVM resource monitoring tool

1. jvisualVM tool

VisualVM provides a visual interface that can monitor threads, memory conditions, view the CPU time of methods and objects in memory, objects that have been GC; in the JDK_HOME/bin directory, double-click the jvisualvm.exe file to open and run it. After opening, it will monitor the java program running locally by default. The running interface is as follows:

2. To connect to a remote server, you need to start the jstatd service on the monitored JVM server

JVM jstat Daemon: a daemon process, an RMI (Remote Method Invocation) server program, used to monitor the resource usage of all local JVMs from creation to destruction, and provide interfaces to monitoring tools (such as VisualVM here), so that The tool can connect to all JVMs on the machine. The command is in the bin directory of jdk

1). First create a security policy file

Create a file jstatd-all.policy and store it in a directory, such as the /u01/apps/ directory (the name and storage location can be arbitrary), the content of the file is:

grant codebase "file:${java.home}/../lib/tools.jar" {       permission java.security.AllPermission;};

Note: The server remembers to configure the JAVA_HOME environment variable

2&#

Guess you like

Origin blog.csdn.net/qq_38571773/article/details/128309009