Transferred from: http://www.cnblogs.com/luihengk/p/5446279.html
I. Find the corresponding process pi for the Java application
Performance test application access address: http://192.168.29.218:7070/training/
The deployed application server is tomcat6.028
- After starting the Tomcat server, you can see the Java.exe process in the Task Manager,
PS: There are several other programs launched here
2. Query the process PID number corresponding to the test application (based on the port number)
1) cmd command: netstat-aon|findstr "7070"
Two Start the Jconsole monitoring tool
Method One:
Open the cmd Command window and go to the/bin directory under the JDK installation path.
Input command: JConsole "pid number"
Automatically start and open the Jconsole monitoring interface:
Method Two: Enter the JDK installation directory bin directory, double-click Run JConsole.exe Program, select the application corresponding PID program connection or double-click
Three Perform performance analysis on charts
Jconsole is primarily a monitoring Java application, which is a tool that comes with the JDK, a JMX-based connection to a running JVM that launches com.sun.management.jmxremote to implement the default JMX management client.
1) Overview
The overview interface provides real-time visibility into the heap memory usage, threads, classes, and CPU usage of Java applications.
2) Memory
The memory interface allows you to select the "Heap memory usage" and "non-heap memory usage" graphs in the chart and display memory details: Using memory, allocation: maximum, etc.
PS: Focus on the use of memory, the reasonable ratio between the use of memory and the maximum value of 1:3, the use of memory can not be greater than 1/2 maximum, or memory bottlenecks.
3) thread
Line Partogram is not a major concern, only focuses on the thread situation, and can detect if there are deadlock threads.
4) class
The class diagram is not a major concern, it is related to the number of application classes and has no fixed value.
1) VM Summary
VM Summary diagram is a view of the JVM usage graph
A heap is a memory space used by Java virtual machines (the JVM, referred to in the following JVM, specifically the Sun hotspot JVM) To hold Java classes, objects, and static members, all objects created in a Java program are allocated space in the heap, and the heap is used only to store objects. The application accesses the heap data through a reference that resides within the stack, and a JVM process can have only one heap. The JVM sets the initial and maximum values of the heap, respectively, with the-XMS and-XMX parameters.
This diagram needs to focus on analyzing the current heap size, the maximum heap size, allocated memory, and the physical total memory and available physical memory.
(turn) Monitor Java program memory and JVM with Jconsole tools