The VisualVM program performance analysis tool is a visual tool that integrates multiple JDK command line tools. It can be used as a tool for Java application performance analysis and operation monitoring. Developers can use it to monitor and analyze thread information and browse memory heap data. System administrators can use it to monitor and control Java applications across the entire network. Java application users can use it to create bug reports containing all necessary information.
VisualVM helps us analyze the memory usage by checking the class and object information loaded in the JVM. We can analyze the memory usage of the application through the Monitoring ID and Profiler label of VisualVM.
2. CPU analysis
VisualVM can monitor the CPU usage of the application over a period of time, display relevant data such as CPU utilization, mode operating efficiency and frequency, and help us discover the performance shortcomings of the application. We can perform CPU performance analysis on the application based on VisualVM's monitoring identification and Profiler tags.
3. Process analysis
The Java language can effectively complete thread synchronization applications. When we calibrate a thread synchronization application or do performance tuning during and after development, we often need to understand the running status of all processes in the current program and whether there are deadlocks, hotlocks, etc., etc. Then analyze the possible shortcomings of the system software.
4. Snapshot analysis
We can use the snapshot function of VisualVM to convert any performance snapshot and save it locally to help us perform performance analysis. Snapshots provide a very fast way to capture application performance data because once the snapshot is converted, it can be opened and viewed without a network connection, and can also be reviewed together.
VisualVM provides two categories of snapshots
Profiler snapshot: When there is a performance analysis session (memory or CPU) in progress, we can use the "Snapshot" button on the performance analysis results menu bar to convert into a Profiler snapshot to capture the performance analysis data at that time.
Application snapshot: We can right-click the application connection point in the Applications dialog box on the left and select "Application Snapshot" to convert it into an application snapshot. Application snapshots collect heap dumps, process dumps and Profiler snapshots at a certain moment, and also capture some basic information about the JVM.
5. Dump function
Generation and analysis of process dumps: VisualVM can convert running local applications into process dumps and print out the local variable footprints of active processes to help us effectively understand the status of process operation and diagnose deadlocks and applications. Hemiplegia and other problems.
Generation and analysis of heap dumps: VisualVM can generate heap dumps, statistically analyze the target information in the JVM at a particular moment, and help us analyze the introduction of targets, whether there are memory leaks, etc.