FreeKB - Configure WebSphere to automatically create a heap dump
Configure WebSphere to automatically create a heap dump

Home > Search

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 automatically creating a heap dump, you can manually create a heap dump

The creation of a heap dump can significantly impact the performance of the application server for several minutes, so you only want to create a heap dump when absolutely necessary. Fortunately, WebSphere can be configured to only create a heap dump when a certain event has occurred, such as an out of memory event.


  1. In the left panel of the WebSphere web console, expand Servers > Server types, and select WebSphere application servers.
  2. Select a JVM.
  3. Select Performance and Diagnostic Advisor Configuration.
  4. Check Enable automatic heap dump collection.
  5. Select OK.
  6. Select Save.

To preserve disk space, if 10 heap dumps already exist in the ${WAS_INSTALL_ROOT}/profiles/your_profile directory or at the directory defined by the IBM_HEAPDUMPDIR variable, additional heap dumps will not be automatically created.


JVM default dump settings

By default, JVMs are configured to automatically create a heap dump when certain events occur. Events that trigger a dump can be added or removed using the Java command with the -Xdump option or the JAVA_DUMP_OPTS environment variable. The -Xdump option is preferred over JAVA_DUMP_OPTS. For example, the following command disables default heap dumps and then enables a heap dump when a full garbage collection event occurs.

/opt/IBM/WebSphere/AppServer/java/8.0/jre/bin/java -Xdump:heap:none -Xdump:heap:events=fullgc class [args...]


It may be easier (and more pratical) to configure Xdump using the admin console.

  1. In the left panel of the WebSphere web console, expand Servers > Server Types, and select WebSphere application servers.
  2. Select the JVM.
  3. Expand Java and Process Management and select Process definition.
  4. Select Java Virtual Machine.
  5. In Generic JVM Arguments, add the Xdump command you want to use.
  6. Select OK.
  7. Select Save.


If using the JAVA_DUMP_OPTS environment variable, one of the following commands would be used to set the environment variable.




After the heap dump has been created, you will want to analyze and respond to the heap dump.


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter in the box below so that we can be sure you are a human.