0% found this document useful (0 votes)
1K views2 pages

Thread and Heap Dump

Thread dumps provide diagnostic information about server hangs by showing active threads. They can be generated automatically on a hang or manually using commands like "kill -3 PID" on Linux. Heap dumps show live objects and references in memory and are used to detect memory leaks. They can be configured to generate automatically on out of memory errors or manually using the "generateHeapDump" operation on the JVM MBean. Multiple heap dumps should be compared to analyze memory usage over time.
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 PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views2 pages

Thread and Heap Dump

Thread dumps provide diagnostic information about server hangs by showing active threads. They can be generated automatically on a hang or manually using commands like "kill -3 PID" on Linux. Heap dumps show live objects and references in memory and are used to detect memory leaks. They can be configured to generate automatically on out of memory errors or manually using the "generateHeapDump" operation on the JVM MBean. Multiple heap dumps should be compared to analyze memory usage over time.
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 PDF, TXT or read online on Scribd
You are on page 1/ 2

Thread Dumps If you get unexplained server hangs under WebSphere, you can obtain, from the WebSphere

e 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. 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,*] wsadmin>$AdminControl invoke $jvm dumpThreads 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.

Heap Dumps 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. 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 > server_name 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.

Generating Manually use kill -3 PID on unix/linux machines. 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 dumps can be found under profile_root\profile-name with naming heapdump.<date>..<timestamp><pid>.phd Use ISA for analyzing heap dumps Note: we always generate multiple dumps with some interval gap and then compare them for analysis.

For getting handle: 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 For generating Core dump: $AdminControl invoke $jvm dumpThreads

You might also like