Sunday 21 October 2012

How to manually generate a Heapdump in WebSphere Application Server


Hi Everyone,

Occasionally a heapdump needs to be generated without waiting for an OutOfMemoryError condition to occur.

For example: an OutOfMemoryError will probably cause a system outage. On a production system this is not a desired event. If we manually create a heapdump before the OutOfMemoryError generates one, then the application server can be recycled and we will get a heapdump without an unscheduled outage.

The manually generated heapdump will not be as useful as one which was generated by an OutOfMemoryError, but sometimes it can be of some use. The longer we can wait before generating the heapdump, the more likely the heapdump will contain the objects causing the OutOfMemory. If the heapdump is generated too soon, the largest memory user is not likely to be the same largest memory user when the heap is completely full.

1. From a Windows Command Prompt, enter the wsadmin.bat command to get a wsadmin command prompt.


 E.g.: [C: \IBM\WebSphere\AppServer\bin\wsadmin.bat]

Note: If security is enabled or the default SOAP ports have been changed, you will need to pass additional parameters to the batch file in order to get a wsadmin prompt. For example:
wsadmin.bat [-host host_name] [-port port_number] [-user userid[-password password]

2. Get a handle to the problem application server:

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

Where server1 is the name of the application server that you want a heapdump from. If wsadmin is connected to a Deployment Manager and if the server names in the cell are not unique, then you can qualify the JVM with a node attribute in addition to the process name.

3. Generate a heapdump:


wsadmin> $AdminControl invoke $jvm generateHeapDump

“Effort only fully releases its reward after a person refuses to quit.”

Regards,
Akhilesh B. Humbe
 

No comments:

Post a Comment

Popular Posts