Article From:https://www.cnblogs.com/cord/p/9455147.html

jps

jpsSimilar to the PS on Unix, which displays local Java processes, you can view several Java programs running locally and display their process numbers

jconsole

jconsole:A Java GUI monitoring tool that can display all kinds of data in a diagrammed form. Remote server VM can also be monitored through remote connections.

jmap

Print out all the’objects’in the memory of a java process (using pid), such as the number of objects that are generated.

java -heap pid      #Display Java heap details
java -histo pid     #Display statistics of objects in heap

jstat

jstatIt is a powerful VM memory monitoring tool that can be used to monitor the various heap and non-heap sizes and memory usage in VM memory.

jstat -class pid        View the number of loaded class and the space occupied.
jstat -compiler pid     View the amount of real-time compilation of VM and other information.
jstat -gc pid           View GC case

S0C:The size of the first surviving area
S1C:The size of the second surviving areas
S0U:The size of the first surviving area
S1U:The size of the second surviving areas
EC:The size of the garden of Eden
EU:The size of the Eden Park
OC:Old age size
OU:Size in old age
MC:Method area size
MU:Method area use size
CCSC:Size of compressed class space
CCSU:Size of compressed class space
YGC:Young generation of garbage collection times
YGCT:Young generation waste recycling time
FGC:Garbage collection times in the old age
FGCT:Consumption time of garbage collection in the old age
GCT:Total waste recycling time

jstat -gccapacity pid   View memory usage in GC

NGCMN:The minimum capacity of the new generation
NGCMX:Maximum capacity of the new generation
NGC:Current generation capacity
S0C:The size of the first surviving area
S1C:The size of the second surviving areas
EC:The size of the garden of Eden
OGCMN:Minimum capacity in old age
OGCMX:Maximum capacity in old age
OGC:Current age size
OC:Current age size
MCMN:Minimum metadata capacity
MCMX:Maximum metadata capacity
MC:Current metadata space size
CCSMN:Minimum compression space size
CCSMX:Maximum size of compressed class space
CCSC:Current size of compressed class space
YGC:Young generation GC times
FGC:Number of elderly generation GC

jstat -gcnew pid            Check the new generation information
jstat -gcnewcapacity pid    Check the memory footprint of the new generation
jstat -gcold pid            View elderly generation information
jstat -gcoldcapacity pid    Look at the memory footprint of older generations.
jstat -gcmetacapacity pid   View memory footprint in metadata area
jstat -util pid             Statistical GC information statistics

jstack

jstack pid          View JVM thread running state, whether there is deadlock phenomenon and so on.
jstack -F pid       pidForce print stack when unable to respond
jstack -l pid       Print additional information about locks
jstack -m pid       Mixed mode output (including Java and local c/c++ fragment) stack

Reference link:

https://blog.csdn.net/wangshuminjava/article/details/80928354

https://www.cnblogs.com/lizhonghua34/p/7307139.html

http://www.cnblogs.com/ggjucheng/archive/2013/04/16/3024892.html

Link of this Article: Commonly used JVM commands

Leave a Reply

Your email address will not be published. Required fields are marked *