0% found this document useful (0 votes)
68 views

Websphere Thread Dump & Heap Dump: Joseph Amrith Raj

This document discusses thread dumps and heap dumps in WebSphere. It defines a thread dump as providing information about executing Java classes to help diagnose hangs, and explains when and how to generate thread dumps using kill commands or wsadmin. It defines a heap dump as a snapshot of live objects and references that can help diagnose memory leaks, and explains when and how to generate heap dumps automatically or manually using kill commands or wsadmin. It also discusses tools for analyzing thread and heap dumps.

Uploaded by

harshad27
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Websphere Thread Dump & Heap Dump: Joseph Amrith Raj

This document discusses thread dumps and heap dumps in WebSphere. It defines a thread dump as providing information about executing Java classes to help diagnose hangs, and explains when and how to generate thread dumps using kill commands or wsadmin. It defines a heap dump as a snapshot of live objects and references that can help diagnose memory leaks, and explains when and how to generate heap dumps automatically or manually using kill commands or wsadmin. It also discusses tools for analyzing thread and heap dumps.

Uploaded by

harshad27
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
You are on page 1/ 11

WebSphere

Thread Dump & Heap Dump

Joseph Amrith Raj


In this presentation

• What is Thread/Heap dump?

• When to generate ?

• How to generate ?

• how to debug ?
Thread Dump
What is a Thread Dump?

• A thread represents a work item or task, such as a servlet request.


Java processes are usually multi-threaded. This means there can
be many tasks occurring simultaneously (multi-threading) within
one JVM process.

• Java thread dumps provide a Java view of a failing JVM process.

• A Java dump provides information about the executing Java


classes and allows the problem determination process to reference
the Java source code.
Thread dump

When to generate ?

• If you get unexplained server hangs under WebSphere,


you can obtain, from the WebSphere server, a thread
dump to help diagnose the problem.
• In the case of a server hang, you can force an
application to create a thread dump.
• If an application server spontaneously dies, look for a
file. The JVM creates the file in the product directory
structure, with a name like javacore[number].txt.
How to generate?

• On unix/Linux machines find the process id (PID) of the hung JVM


and issue kill -3 PID. Look for an output file in the installation root
directory with a name like javacore.date.time.id.txt.

• Using wasadmin prompt,

get the handle of the server


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

then execute
wsadmin>$AdminControl invoke $jvm dumpThreads
Thread dump analysis tool

• Download thread analyzer from IBM website to


analyze the generated thread dumps.
-http://www.alphaworks.ibm.com/tech/jca
Heap Dump
What is a heap dump?

• A heapdump is a snapshot of JVM memory. it shows the live objects on the


heap along with references between objects. It is used to determine
memory usage patterns and memory leak suspects.

When to generate?

• Memory leaks in the Java heap produce java.lang.OutOfMemoryError


exceptions in log files. However, not all out-of-memory errors are caused
by Java heap memory leaks. Out-of-memory errors can also be caused by
the following conditions:
– Java heap fragmentation. This fragmentation occurs when no contiguous chunk
of free Java heap space is available from which to allocate Java objects.
Various causes for this problem exist, including the presence of pinned or
dosed objects or because of the repeated allocation of large objects.
– Memory leaks in native heap. This problem occurs when a native component,
like DB2 connections, is leaking.
How to generate?

• To enable automated heap dump generation support, perform the following steps in the
administrative console: (heap dump will generated upon receiving the out.of.memory
exceptios)
– 1. Click Servers > Application servers in the administrative console navigation tree.
2. Click server_name >Runtime Performance Advisor Configuration.
3. Click the Runtime tab.
4. Select the Enable automatic heap dump collection check box.
5. Click OK.

• To generate manually
– use kill -3 PID on unix/linux machines.

• Using WSADMIN tool


– Invoke the generateHeapDump operation on a JVM MBean, for example,

– * Finding JVM objectName:


<wsadmin> set objectName [$AdminControl queryNames
WebSphere:type=JVM,process=<servername>,node=<nodename>,*]

– * Invoking the generateHeapDump operation on JVM MBean:


<wsadmin> $AdminControl invoke $objectName generateHeapDump
Heap dump analysis

• heap dumps can be found under


profile_root\profile-name with naming
heapdump.<date>..<timestamp><pid>.phd

• Use HeapAnalyzer or MDD4J for analyzing heap


dumps
About the presentor

I'm an IBM certified Websphere consultant


having expertise on application servers, web servers, MQ, message
broker, portal server, process server, SOA, LDAP and unix

http://josephamrithraj.mp

http://josephamrithraj.wordpress.com

http://activexpert.123guestbook.com

http://twitter.com/activexpert
• Feel free to share this
with your friends or on
your website/blog

– Joseph

You might also like