当前位置:网站首页>Jcmd of JVM command: multifunctional command line

Jcmd of JVM command: multifunctional command line

2022-07-07 06:08:00 Zhang Junjie 1994

Study Silicon Valley Song Hongkang JVM From entry to mastery Learning notes of

summary

stay jdk1.7 in the future , Added this command line tool ,jcmd, This tool is like a Swiss Army knife , Integrated jstat All other command functions , For example, with jcmd Command to export the heap 、 Memory usage 、 see Java process 、 Export thread information 、 perform GC、JVM Running time and so on .
jcmd Yes jmap Most of the functions , And in Oracle It is also recommended on the official website of jcmd Name substitution jmap command .
image.png

Basic grammar

jcmd -l

List all JVM process

image.png

The above operation is similar to jsp It's very similar

jcmd Process number help

For the specified process , What commands can be used

image.png

jcmd Process number Specific commands

Displays the data of the command for the specified process

Replace the previous operations according to the above command :
Thread.print Can replace jstack Instructions
GC.class_histogram Can replace jmap Medium -histo operation
GC.heap_dump Can replace jmap Medium -dump operation
GC.run You can see GC Implementation of
VM.uptime You can see the total execution time of the program , Can replace jstat Directive -t operation
VM.system_properties Can replace jinfo -sysprops process id
VM.flags Can get JVM Configuration parameter information of

Print thread information
image.png
adopt Thread.print Can replace jstack Instructions Check whether the program has deadlock
image.png


GC.heap_dump Can replace jmap Medium -dump operation
image.png

Generates a heap dump


image.png
Display the parameters of virtual machine configuration

原网站

版权声明
本文为[Zhang Junjie 1994]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070046517075.html