Dumping the Thread: WebSphere Performance Analysis
When tackling performance issues in development or production, budget constraints often prevent access to premium profiling tools like JProbe or YourKit. The good news: WebSphere Application Server (WAS) has built-in tooling for thread and heap dumps.
What Is a Thread Dump?
A thread dump is “a list of all the Java threads that are currently active in a Java Virtual Machine (JVM).” The JVM collects thread statistics and outputs them to a text file when signaled. Heap dumps capture the full state of JVM memory at a point in time.
Method 1: wsadmin Utility (Recommended)
# Navigate to the bin directory
cd <was_root>/profiles/<PROFILE_NAME>/bin/
# Connect via wsadmin
wsadmin.bat -conntype SOAP -username <user> -password <pass>
# Set the JVM object variable
set jvm [$AdminControl completeObjectName type=JVM,process=<server>,node=<node>,*]
# Generate thread dump
$AdminControl invoke $jvm dumpThreads
# Generate heap dump
$AdminControl invoke $jvm generateHeapDumpFull Example
wsadmin.bat localhost 9443 -username ADMIN -password password
set jvm [$AdminControl completeObjectName type=JVM,process=server1,node=5184Node01,*]
$AdminControl invoke $jvm dumpThreadsMethod 2: OS-Level Signals
- Linux/Mac:
kill -3 <pid>(find PID withps -ef | grep java) - Windows (console mode):
Ctrl+Break
Analyzing the Output
IBM’s Thread and Monitor Dump Analyzer for Java (JCA) from Alphaworks makes manual interpretation much more tractable. The tool’s FAQ section is particularly useful for understanding common threading patterns and deadlock signatures.
For heap analysis, IBM HeapAnalyzer is the companion tool worth grabbing from the same source.