Tuesday, November 17, 2009

How to take a heapdump and a javacore on a WebSphere Portal server

Sometimes taking a heapdump or a javacore on a Portal system can help to diagnose hung threads or a stalled system. A heapdump is a dump of the memory of the Java heap. A javacore provides insights into the various processing running inside of the heap at a given time.

Javacores should be taken two minutes apart in order determine if processes are hanging across intervals.

Depending on the version of Portal/WAS installed, the heapdumps and javacores are placed in different locations on the filesystem.

For Portal 5.1, the files are placed in /usr/WebSphere/AppServer
For Portal 6.0, the files are placed in /usr/IBM/WebSphere/AppServer/profiles/wp_profile

The files will be called something like heapdump434360.1198699170.phd and

Use these instructions to get started:

1. Find out the PID (process ID) of the Portal server by typing 'ps -ef|grep java'.
2. Type 'kill -3 '
3. Wait.
4. Verify that the heapdump and javacore were finished by checking in the appropriate directory.
5. Wait two minutes, and then run 'kill -3 '
6. Wait
7. Verify that they were created.