The basic tuning step jvm

1, jps view the application process
2, jinfo -flags pid look at some parameters have been assigned
3, jstat
view class loading information
jstat -class PID 1000 10 view a java class loading process information, the output of each 1000 milliseconds, total output 10 times
to see garbage collection information
jstat -gc PID 1000 10
4, jstack
view the thread stack information
jstack PID
5, jmap
Health piles of snapshots
jmap -heap PID
dump a heap memory-related information
jmap -dump: format = b, file = heap.hprof PID
jvm-allocation parameters will automatically generate dump files, without having to manually generate.
-XX: + HeapDumpOnOutOfMemoryError -XX: HeapDumpPath = heap.hprof


Common analysis tools:
1, JConsole
2, jvisualvm
3, arthas
arthas commonly used commands:
Version: View version number arthas

help: View Named help

cls: clear the screen

session: View current session information

quit: Exit arthas client

dashboard: the current process real-time data panel

thread: the current JVM thread stack information

jvm: View the current information the JVM

sysprop: View the JVM system properties

sc: View class information JVM has been loaded

dump: dump class byte code has been loaded into a specific directory

jad: decompile specify the source of the loaded class

monitor: monitor execution method

watch: The method of performing data observation

trace: internal method invocation path, time consuming, and each node on the path output method

stack: output current method invocation path is called

......
4, MAT file analysis tool
5, gc log analysis
-XX: + PrintGCDetails -XX: + PrintGCTimeStamps -XX: + PrintGCDateStamps -Xloggc: gc.log

gc log analysis tool:
Online: http: //gceasy.io
Offline: GCViewer

Guess you like

Origin www.cnblogs.com/sunny-miss/p/12057610.html