FAQs

Frequently Asked Questions - outofmemoryerror

FAQs - outofmemoryerror

First you may try increasing the JVM heap memory size by adjusting the values of the -Xmx and/or -XX:MaxPermSize JVM command line arguments to increase the maximum available JVM heap size and the JVM perm space respectively. Please refer to your JVM documentation for details on how to use these parameters.

If the problem remains, you will need to obtain a heap dump from the JVM and analyze it using one of the available Java memory heap analysis tools. We recommend using the free Eclipse Memory Analyzer Tool.

We strongly recommend adding the following JVM command line arguments that instruct the JVM to automatically produce a heap dump file when the OutOfMemoryError occurs. 

-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=<heap dump output directory>

Make sure there is enough free disk space in the specified heap dump output directory because the generated heap dump files can be very large. For example, for a JVM running with the maximum heap size of 1GB, the size of the generated heap dump file can be up to 1GB. The specified heap dump output directory must be writable by the user/group the JVM process is running under.

Please note that -XX:+HeapDumpOnOutOfMemoryError and -XX:HeapDumpPath JVM arguments can be safely used in all production or production-like environments as they do not impact the JVM performance in any way.