Read about 5 minutes, this tutorial is very practical, clear case study, recommended collection

  • Query to monitor the Java process (pid) reference: javapub.blog.csdn.net/article/det…

@[toc]

Jstat profile

  1. Jstat is located in the Java bin directory and uses JVM built-in directives to monitor Java application resources and performance on the command line in real time, including Heap size and garbage collection status.

  2. Jstat can be used to monitor various heap and non-heap sizes in VM memory and their memory usage.

  3. Jstat-class pid: displays information such as the number of loaded classes and space occupied by them.

  4. Jstat-compiler PID: Displays information such as the number of VMS compiled in real time.

  5. Jstat -gc PID: Displays gc information, number of gc counts, and time. The last five items, respectively, are the number of young gc, the time of young GC, the number of full GC, the time of full GC, and the total time of GC.

Format of the Jstat command

jstat [optionsvmid [interval[s|ms] [count]]]

The instance

Command:

jstat -gc -h3 6556 250 10

Monitor GC, output the table header every three lines, the monitoring program PID is 6556, output every 250ms, a total of 10 times.

The return value:

S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 S0C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU FGC FGCT GCT 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060 S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 4096.0 5120.0 3984.0 0.0 61952.0 47543.9 173568.0 56.0 11648.0 11076.1 1408.0 1239.5 6 0.060 0 0.000 0.060Copy the code

Screenshots:

Parameter detailed parsing

Detailed description of the use method, simple to understand -class

Class loader. Loaded: The number of Loaded classes. Bytes: number of Unloaded memory, in kBs Unloaded classes. Bytes: indicates the number of unmounted memory. Unit: kBs Time: indicates the total Time for loading and uninstalling a class.Copy the code

-compiler Indicates the compiler.

Compiled: indicates the number of compilation tasks Failed: indicates the number of compilation task failures. Invalid: indicates the number of Invalid compilation tasks. Time: indicates the total Time spent by all compilation tasks. FailedType: type of the latest failed compilation task. FailedMethod: Name of the class and method in the last failed compilation taskCopy the code

– Gc heap memory collection

S0U: used memory of Survivor zone 0 (kB). S1U: Used memory of Survivor zone 1 (kB). EC: Eden Zone capacity (kB).eu: Used memory of Survivor zone 0 (kB). OU: used memory in the old area (kB). MC: used memory in the metadata area (kB). MU: Used memory in the metadata area (kB). CCSC: Used memory in the class compression area (kB). Class compressed area used memory (kB).yGC: Number of new garbage collection events. YGCT: New garbage collection time. FGC: Total of garbage collection events. FGCT: A complete garbage collection time. GCT: All garbage collection times.Copy the code

Welcome to pay attention to the author’s public number: JavaPub, white piao original e-book and actual combat project