JVM common management commands

Look at the number of objects
jmap -histo [pid]>jmaphisto.log
jmap -F -histo [pid]>jmaphisto.log The service is dead and add -F
jmap -histo:live [pid]>jmaphisto.log Just look at the survival (will trigger fullgc re-export)

看内存Dump
jmap -dump:format=b,file=jmapdump.hprof 【pid】
jmap -F -dump:format=b,file=jmapdump.hprof 【pid】
tar zcvf jmapdump.hprof.tar.gz jmapdump.hprof

Check the GC status
jstat -gccapacity
jstat -gcutil [pid] 1000 100 Check the memory status every 1000 milliseconds for 100 times

Explanation of indicators:
S0 — Survivor space on Heap, percentage of used space in area 0
S1 — Survivor space on Heap, percentage of used space in area 1
E — Eden space on Heap, percentage of used space in area
O — Old on Heap The percentage of used space in the
space area P — Perm space The percentage of used space in the area
YGC — The number of times Young GC occurs
from application startup to sampling time YGCT — The time (in seconds) used by Young GC from application startup to sampling time (in seconds)
FGC — Number of Full GCs
from application startup to sampling time FGCT – Time from application startup to sampling time for Full GC (in seconds)
GCT — Total time for garbage collection from application startup to sampling (in seconds) )

Look at the thread stack
jstack [pid] >jstack.log
jstack -F [pid] >jstack.log service is dead add -F
jstack -F -m [pid] >jstack.log
jstack -F -m -l [pid] > jstack.log

Look at the resource status of the thread
pstree [pid] Print the thread usage of the process

top View resource usage
top -Hp [pid] View thread resource status in the process Convert
to hexadecimal with jstack to query thread cpu status

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324753532&siteId=291194637