Download Generating HeapDump PDF

TitleGenerating HeapDump
TagsJava Virtual Machine Java Programming Language Thread (Computing) Operating System Technology Computer Data
File Size443.3 KB
Total Pages7
Document Text Contents
Page 1

Generating Heap dumps and Thread dumps
Heap Dumps

Heap dump is a text file which keeps record of all objects in the java heap. It contains the

information like size and address of all objects, as well as the addresses of all objects that it


Heap dump is nothing but a snap shot of our JVM’s Heap memory,contains all active java

objects and their activities which object doing what and how much memory it is occupying.

whenever OutOfMemoryException occurs Websphere application Server creates heap dump

in profile's home directory.

It is useful in situations, most notable for memory leak problems or memory allocation

problems for exaple OutOfMemoryExceptions.

Automated heap dump generation (Server must start)

Set up for enabling heap dump:

 For V6.0 release:
1. To set the following Environment Entries from the administrative console:

Select Servers > Application Servers >server_name> Java and Process
Management > Process Definition > Environment Entries > New

2. Add the following Name/Value pairs:


IBM_HEAPDUMPDIR your_directory



3. Make sure that you save changes to the master configuration

1.Click Servers > Application servers in the administrative console navigation tree.

Page 2

Page 4

Generating Heap dump Manually

set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]

Where server1 is the name of application server for which we want heapdump.

For generating heap dump:

$AdminControl invoke $jvm generateHeapDump

Generating Thread dump Manually

set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]

Where server1 is the name of application server for which we want heapdump.

For generating Thread dump:

$AdminControl invoke $jvm dumpThreads


use kill -3 PID on unix/linux machines.

Thread Dump:

When we trigger a thread dump on an application server, all active thread information will be dumped

into file which is normally known as thread dump. In this dump file, we can get information about thread

like active thread, hung thread, dead lock, runnable and inactive thread info.

Command to generate thread dump: kill -3 PID_OF_SERVER

When our application server reports the thread hung conditions in SystemOut.log file then we generate

thread dump to analyze the reason behinds thread hungs. We are generally having thread hung situation

when any threads coming to system becomes unresponded.

When Websphere Application Server detects that a thread has been active longer than the time defined by

the thread monitor threshold then it write below error code in SystemOut.log file:

• WSVR0605W: Thread threadname has been active for hangtime and may be hung. There are

totalthreads threads in total in the server that may be hung.

Where: threadname is the name that appears in a JVM thread dump, hangtime gives an approximation of

how long the thread has been active and totalthreads gives an overall assessment of the system threads.

If the above thread gets released by itself then we get below entry in our log file:

• WSVR0606W: Thread threadname was previously reported to be hung but has completed. It was

active for approximately hangtime. There are totalthreads threads in total in the server that still may be


Page 6

The time between garbage collections will increase, but the garbage collection
will take longer, which indirectly effects the turn-around-time of the applicaiton performance.
Because it delays the start of garbage collection until the heap is full. The
first time that the Garbage Collector runs, therefore, becomes a very expensive operation.
Also, the heap is more likely to be fragmented and require a heap compaction. Again this is
a very expensive operation.


We can take thread dump on WAS using wsadmin tool in the following way.


WASX7209I: Connected to process “server1″ on node WKHANFXPNode02 using SOAP conn

ector; The type of process is: UnManagedProcess

WASX7029I: For help, enter: “$Help help”

wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]




wsadmin>$AdminControl invoke $jvm dumpThreads

This will create a java core file in the following directory



We need to download IBM Thread Dump Analyzer from here

Start the tool using the following command

E:\tools\jca412>java -Xmx515m -jar jca412.jar

Open the thread dump from

Similer Documents