Tip-jcmd

2019-05-12  本文已影响0人  cctoken

jcmd
Sends diagnostic command requests to a running Java Virtual Machine (JVM).

Synopsis

jcmd [-l|-h|-help]

jcmd pid|main-class PerfCounter.print

jcmd pid|main-class -f filename

jcmd pid|main-class command[ arguments]

Description

The jcmd utility is used to send diagnostic command requests to the JVM. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM.

使用方式

jcmd 或者 jcmd -l 可以查看当前机器上,所有jvm的实例进程


image.png

jcmd -h 可以查看帮助文档


image.png

通过 jcmd <pid|main-class> help 的方式可以获得当前进程,哪些command是支持的


image.png

再通过 jcmd <pid|main-class> help command 的方式,可以查看当前的command的使用方式


image.png

最后 可以执行 jcmd <pid|main-class> <command arguments> send command to vm

image.png

关于具体的 command的含义可以通过help指令查看

上一篇下一篇

猜你喜欢

热点阅读