Creating a java heap dump for a java process
A heapdump is a snapshot of the memory of the application at a specific moment in time. It can be very useful as diagnostic information when memory issues occur. However, using a heapdump without knowing what to look for, is difficult. It is like searching for a needle in a haystack.
Automatically generating a heap dump
Add the following parameters to your Tanuki configuration file to automatically create a heap dump when Java goes out of memory:
wrapper.java.additional.xx=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.xx=-XX:HeapDumpPath=path to folder to save heap-dump
Manually generating a heap dump
1. Open Task Manager on the machine where the java process is running.
2. From the list of running processes, locate the java process related to Planon.
The process name is “OpenJDK Platform binary”. Filter on the Command Line column to find it.
3. If PIDs are not displayed, add the column to the Task Manager
4. Remember or note down the PID of the Planon Java process.
5. Open the command prompt as administrator.
6. Execute the following command at the location: ..\Server\\jdk-* bin to create a .hprof dump:
jmap -dump:format=b,file=YourFileName.hprof PID
YourFileName.hprof: can include a file path e.g. c:\dump\myfile.hprof
This file can be analysed with Eclipse mat or jProfiler.