Generating a heap dump will be useful to understand a possible memory leak. A heap dump consists of the recorded state of the working memory of a computer program at a specific time. A heap dump will contain all objects in memory, their size and object type at the time of generation of the dump. Heap dumps are useful in the context of troubleshooting issues to determine memory leaks and/or troubleshooting java.lang.OutOfMemoryError at the JVM level.
Be aware that generating a heap dump will have a severe performance impact on the system during the time the heap dump is being collected. As a result, make sure to perform the collection during a maintenance window that will not affect end users using the system.
Automatic collection
To capture a heap dump automatically in the event of a java.lang.OutOfMemoryError, add the following option to the Java startup parameters:
-XX:+HeapDumpOnOutOfMemoryError
jmap -dump:file=app.bin <PID>
The third-party product(s) discussed in this technical note is manufactured by vendors independent of Strategy. Strategy makes no warranty, express, implied or otherwise, regarding this product, including its performance or reliability.