Loading

How to gather heap dump on JVM out of memory error

Julkaisupäivä: Mar 2, 2024
Tehtävä

GOAL

The Mule server throws OutOfMemoryError and you need to gather a heap dump when this happens. The error looks like this:

java.lang.OutOfMemoryError: Java heap space

Note that you'll be required to restart the Mule server after applying this change, and reproduce the OOM error one more time.

Vaiheet

For On-Prem servers:

Oracle Java Virtual Machine provides a JVM modifier to gather this information.
To apply this modifier to the JVM used by Mule, you can set a parameter in /conf/wrapper.conf which automatically triggers the creation of a heap dump during:

wrapper.java.additional.<n>=-XX:+HeapDumpOnOutOfMemoryError 
wrapper.java.additional.<n>=-XX:HeapDumpPath=path/to/dumps/dump.hprof
* change <n>  to a number that follows the sequence

If no path is defined for heap dump file will be created in the directory from which the Java process was launched. The heap dump file should then be generated as
Filename:
java_pid<pid>.hprof.<unique number>

For CloudHub:

1. Raise a case to MuleSoft Support to request enabling HeapDumpOnOutOfMemoryError on the CloudHub worker.
2. Once the error occurs, raise a severity 1 case to MuleSoft Support for production environments or a severity 2 case for non-production environments if the previous case has been closed. Then, MuleSoft Support team will be able to collect the requested heap dump.

For RTF

How to Get Heap Dump On Out Of Memory App Restart in RTF?

Related Articles

How-to-pass-additional-startup-arguments-to-Mule

If your server is not responsive but you are not sure if it's a memory issue, please review this guide.

Knowledge-artikkelin numero

001114831

 
Ladataan
Salesforce Help | Article