jcmd : where can I find complementary information

后端 未结 2 841
臣服心动
臣服心动 2021-02-08 11:50

jcmd is a promising tool regrouping utilities of jmap, jsp, etc...
You can find introduction and man page but still it\'s very light.

On the web, I

2条回答
  •  广开言路
    2021-02-08 12:05

    jcmd itself provides such information when applied on a specific Java process, and optionally a specific sub command.

    How to get help:

    • First get java process lists via jps or jcmd -l, if you don't know the pid of target java process yet, (e.g I will take java process with pid 8976 as example in subsequent steps).
    • Then apply help sub command on a specific java process, e.g jcmd 8976 help, it will list available sub commands for the process.
    • Then, get help for a specific command on the process, e.g jcmd 8976 help Thread.print, it will print help of Thread.print sub command.
    • Then, execute the specific sub command on the process, e.g jcmd 8976 Thread.print or jcmd 8976 Thread.print | less -N

    By the way, just as you mentioned, following link describes jcmd command briefly: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr006.html

提交回复
热议问题