Search This Blog

Sunday, September 5, 2010

How to generate and analyze websphere heap dump ?

If you need to generate and analyze websphere heap dump , here is the complete action you need to take.

1. There are many ways to generate heap dump , the next way looks like the easiest ( for me ) to generate manually the heap dump
i used the next two commands in the wsadmin:
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,node=MYXXXNode01,*]

$AdminControl invoke $objectName generateHeapDump

2. To analyze the output - download two useful tools - to analyze heap dump :
to run heaproot i used:
java -jar HR207.jar "C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\heapdump.20100905.152441.6336.0001.phd"

command sample:
ts -100 ->Tabulating all objects (100), sorted by total-size
os -100 -> Showing all objects(100), sorted by size.
up -> move up with the results
down -> move down with the results (next chunk)
os -100 > tt.txt  -> redirect results to file tt.txt

to run heapanalyzer i used ( its failed to open large heap dump):
java -Xmx1000m -jar ha406.jar "C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\heapdump.20100905.152441.6336.0001.phd"

all commands tested on windows with websphere 7.0 , should be ok on linux platform.

reference:
Generating heap dumps manually
Solving memory problems in WebSphere applications
Webcast replay: Using IBM HeapAnalyzer to diagnose Java heap issues

enjoy
Yaniv T

No comments: