first, what is Jconsole?
Jconsole has been introduced from Java 5. Jconsole is a built-in Java performance Analyzer that can be run from the command line or in a GUI shell. You can easily use Jconsole (or, perhaps, its more high-end "close cousin" VISUALVM) to monitor Java application performance and track code in Java. second, how to start jconsole if it is started from the command line, so that the JDK on the PATH, run Jconsole. If you start from the GUI shell, locate the JDK installation path, open the Bin folder, and double-click jconsole . As shown in the following illustration:
When the profiling tool pops up (depending on the version of Java that is running and the number of Java programs that are running), a dialog box may appear asking for the URL of a process to connect, or a number of different local Java processes (sometimes including the jconsole process itself) to connect. As shown in the figure:
To analyze that program, double-click the process. third, how to set the Java program Runtime can be jconsolse connection analysis of the local program (relative to the computer to open jconsole), without setting any parameters can be locally opened Jconsole connection (Java SE 6 start without setting, Before you still need to set Run-time parameters-dcom.sun.management.jmxremote) Iv. jconsole How to connect to a remote machine Java program (for example)
You can use the command directly: Java code jconsole.exe 192.168.0.181:8999
You can also select the remote process-> Enter the remote host IP and port number-> Click "Connect" in the Jconsole interface that has already been opened-> New connection->
Performance Analysis
Include these six tags after entering the view: Overview: Displays overview information about the Java VM and monitored values. Memory: displaying memory usage information thread: Display thread usage information class: Display class mount information *VM Summary: * Display Java VM information Mbeans: display Mbeans.
The image above describes the information we need, and right click to save the data to the CSV file.
Memory
Memory typically requires us to view, see heap memory, non heap memory, memory pool status, total memory allocation and usage, and the number and time of different GC garbage collection. The GC can be viewed manually for memory changes. This is useful when analyzing Java memory issues, you learn the JVM memory model, and then you find that every value here is meaningful. GC Algorithms and parameters have a significant effect on performance, note garbage collection times, time, and partial GC and full GC, adjust the different GC and the parameters under each GC, and then observe in this view for good performance.
In addition to the memory above, there are threads, classes, VMS, Mbean, and so on, which can be viewed as needed.