Before creating a heap dump, you usually want to define the directory where the heap dump will reside and define the amount of memory the application server has for the heap. Instead of manually creating a heap dump, you can configure WebSphere to automatically create a heap dump.
Manually create a heap dump using the WebSphere web console
- In the left panel of the WebSphere web console, expand Troubleshooting and select Java dumps and cores.
- Check the JVM and select Heap dump.
In this example, a heap dump is manually created for the server4 JVM.
Manually create a heap dump using the wsadmin utility
Launch wsadmin using the Jacl language, and then issue the following commands.
wsadmin> set objectName [$AdminControl queryNames WebSphere:type=JVM,process=<servername>,node=<nodename>,*] wsadmin> $AdminControl invoke $objectName generateHeapDump
After the heap dump has been created, you will want to analyze and respond to the heap dump.