Bootstrap FreeKB - IBM WebSphere - Automatically create a heap dump
IBM WebSphere - Automatically create a heap dump

Updated:   |  IBM WebSphere articles

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 WebSphere admin console, expand Servers > Server types, and select WebSphere application servers.
  2. Select an application server.
  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 generic JVM argument or the JAVA_DUMP_OPTS environment entries. Refer to creating generic JVM arguments for the steps on how to create generic JVM arguments. Refer to creating environment entries for the steps on how to create environment entries. The -Xdump generic JVM argument is preferred over JAVA_DUMP_OPTS environment variable. In this example, there is a generic JVM argument to create a heap dump when a fullgc (full garbage collect) event is detected.

 

In this example, the same configure is done via an environment entry.

 

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

JAVA_DUMP_OPTS="ONANYSIGNAL(HEAPDUMP)"
JAVA_DUMP_OPTS="DUMP(HEAPDUMP)"
JAVA_DUMP_OPTS="ERROR(HEAPDUMP)"
JAVA_DUMP_OPTS="INTERRUPT(HEAPDUMP)"
JAVA_DUMP_OPTS="EXCEPTION(HEAPDUMP)"
JAVA_DUMP_OPTS="OUTOFMEMORY(HEAPDUMP)"

 


 

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

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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