Skip to main content

Accessing Heap Dump


Drew Kreiger
Rock star
Forum|alt.badge.img
  • Senior Community Builder at StreamSets
  • 95 replies

Sometimes it may be necessary to take a heap dump (memory snapshot) of a running pipeline or data collector in order to troubleshoot issues such as memory leaks or excessive memory consumption by a stage.

The most commonly known tool for doing this is jmap which is included in the Java Development Kit (JDK). This tool has actually been superseded by another tool called jcmd which is available not only in the JDK but also in the server Java Runtime Environment (JRE) which is what is installed in the official StreamSets Docker image.

Detailed usage is available at the following URL: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr006.html

Taking a Heap Dump can be done by issuing the following command:

jcmd <pid> GC.heap_dump <filename>.hprof

this is equivalent to the old jmap command:

jmap -dump:file=<filename>.hprof <pid>

 

-Adam Kunicki

October 28, 2020 15:22
Did this topic help you find an answer to your question?
This topic has been closed for comments