Skip to main content
Version: 8.2.x

Generating Heap Dump

Java virtual machine heap dumps are used to diagnose memory and performance problems.

Automatic Heap Dumps​

To set your server to generate heap dumps automatically when a heap out of memory error occurs:

  1. Open the startup script of your server with a text editor.
  2. Modify JAVA_OPTS to include the following: -XX:+HeapDumpOnOutOfMemoryError.
  3. Restart your server.

On Demand Heap Dumps​

Elastic Path recommends using JMap for generating heap dumps on demand.

note

JMap will essentially stop your JVM (Java Virtual Machine) throughput until it is complete; and it may take 10+ minutes.

  1. Make sure your server is running.

  2. With the command prompt, get the Java PID(Process Identifier) of your server using the following command: jps -l PID(Process Identifier) of the server will be identified by one of the Java class names listed below:

    • Tomcat 9.0: org.apache.catalina.startup.Bootstrapstart
  3. Run the following command to generate a heap.bin file in your current directory.

    jmap -heap:format=b <java_pid>
Analyzing the Heap Dump

Elastic Path recommends you use either the Eclipse Memory Analyzer Tool plugin or IBM HeapAnalyzer for analyzing heap.bin.