November 2017
Intermediate to advanced
398 pages
10h 14m
English
A heap dump can be generated either manually or through automated processes. To do so manually, you can execute the following command:
sudo -u <username> jmap -dump:file=headdump.hdprof,format=b <pid>
Taking the preceding command as an example, you need to make sure that the relevant process ID is used in place of the pid, as shown previously. Also, the process owner should be replaced with the user to ensure the correct instructions. Otherwise, you will not be able to generate a valid heap dump.
To generate heap dumps using automated processes, you will need to use either the JRockiet R28+ or the HotSpot Java VM 1.5+ and include the parameter shown as follows:
-XX:+HeapDumpOnOutOfMemoryError
This will cause the Java ...