1. Vm process status tool JPS

JPS, the JVM Process Status Tool, is used to list the Java virtual machine processes currently running.

JPS [-q] [-mlvv] []

The command has the following options:

-q: Outputs only the process number

-m: Displays the parameters passed to the main method

-l: displays the full class name of the main method, or the Jar path if it is run in Jar mode

-v: Displays the parameters passed to the JVM

2. Vm statistics monitoring tool Jstat

Jstat is a JVM Statistics Monitoring Tool used to monitor the running status of virtual machines.

Command format: jstat – [-t] [-h] [[]]

Common options of this command are as follows:

-class: monitors the number of classes loaded and unloaded and the time it takes to load a class

– GC: monitors the usage of each interval in the Java heap and the gc time

-gcutil: This option is similar to -gc, except that only the usage is displayed

-gccause: This option is similar to -gc, but it has a reason for the garbage collection

The meanings of the following fields in the output of this option:

S0: Survivor 0 usage

S1: Survivor 1 usage

E: Eden space usage

O: Old space usage

M: Metadata usage

CCS: Compressed class space capacity

YGC: Number of Cenozoic GC

YGCT: Total time of Cenozoic GC

FGC: the number of GC in the old age

FGCT: Total GC time in old age

GCT: indicates the total GC time

LGCC: Last GC cause

GCC: indicates the current GC cause

Java configuration information tool JINFO

Jinfo is Configuration Info for Java, which is used to view vm parameters.

Command format: jinfo [option], -sysprops Displays Java system properties. If no option is selected, the default configuration information of the specified process ID is displayed

4, memory image tool JMAP, very useful

Jmap, which stands for JVM Memory for Java, is used to export Memory snapshots of Java processes. The jMAP is used with the Memory snapshot analysis tool to locate Memory leaks.

Command format: jmap [option]

Main options:

-dump: [live,] format = b, file = filename: exports memory snapshots. The live option indicates that only live objects are exported. Note: This option causes SWT, so don’t use it

– finalizerInfo: displays objects waiting for the Finalizer thread to execute the Finalize method in the F-Queue Queue

-heap: Displays detailed Java heap information

-histo: displays statistics about objects in the Java heap

-f: Forcibly generates a dump snapshot when no response is received using -dump

Five, thread stack trace tool JStack

Jstack, which stands for Stack Trace for Java, is used to generate snapshots of vm threads at the current time.

Jstack -f [-m] [-l]

Options:

-l: Displays other information about locks

-m: Prints the stack in mixed mode, including C/C++ and Java

-f: Forcibly outputs stack information when there is no response

Java VisualVM, a visual monitoring tool

Java VisualVM is a visual performance monitoring tool of the JDK, which is generally used for debugging in the native development environment. You can view JVM parameters, system properties, thread health, and more. Can check http://docs.oracle.com/javase/8/docs/technotes/guides/visualvm/index.html for more information

A very useful performance monitoring tool for Java virtual machines