External tools monitoring – command line

0 Likes

JDK command line utilities

  • can monitor local Java processes
  • JDK needs to be installed on the machine
  • do not produce such an overhead on the JVM

Jmap – takes memory ( heap) dumps

  • needed when JVM is crashing and not creating hprof files
  • when JVM is slow, non-responsive
  • or when the application itself (or execution) is slow, flows stuck in Running
  • Only 1 time!
  • Can be affecting the JVM for a few seconds (hang)

> jmap -dump:format=b,file=<file-path> PID

Jstack – takes thread dumps

  • Needed when certain operations seem to be stuck at the same point
  • Take 5 consecutive thread-dumps at 3-10 sec interval

> jstack PID >  <file-path>

Jcmd

  • comprises jstack, jmap and jinfo functionalities
  • more powerful , complex

> jcmd PID Thread.print  <file-path>

> jcmd PID GC.heap_dump  <file-path>

  • For Linux machines only! Thread-dumps can be taken with kill command

> kill -3 PID > /tmp/td1

Labels:

Support Tips/Knowledge Docs
Comment List
Related
Recommended