Pivotal Knowledge Base

Follow

Creating heap dumps for a tc Server instance in Pivotal tc Server (2010463)

Creating heap dumps for a tc Server instance in Pivotal tc Server (2010463)

Purpose

Thread dump and heap dumps are necessary for troubleshooting issues in a Pivotal tc Server instance. What are the tools and steps needed to create thread dump and heap dump for a tc Server instance.

 

Resolution 

Getting a thread dump for Linux

To obtain a heap dump, you must open the tc server start-up script setenv.sh (located under the bin folder) and edit JAVA_OPTS.

 
Add the following parameters to the JAVA_OPTS.
 
JAVA_OPTS='-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/dir'
 
These are examples of setting parameters that you can also set for heap dumps:
 
  • Path to directory or filename for heap dump:

    -XX:HeapDumpPath=./_pid.hprof

  • Dump heap to file when an OutOfMemoryError is thrown:

    -XX:-HeapDumpOnOutOfMemoryError

 

To obtain a heap dump using jmap.

    jmap -dump:file=heapdump.hprof,format=b <pid>

 

To obtain a heap dump using kill command.

        kill -3 {pid}

    check output log in catalina.out

 

"pid" is the process id of the java process running obtain from:

        ps -ef | grep java 

 

Also, executed as as the user on the box where the process is running.

Getting a thread dump for Windows

Note that the getting a thread dump depends on the operating system you are using. For information on getting a thread dump for windows, see this blog post,  Creating java dump on windows

 

 

©Pivotal 2013

Comments

Powered by Zendesk