How to get a Java Heap Dump

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

If you receive the java.lang.OutOfMemoryError: Java Heap Space error and you have eliminated the usual causes, you may need to get a Java heap dump to determine the cause.

Solution

Getting a heap dump

To get a heap dump add the -XX:+HeapDumpOnOutOfMemoryError parameter to your system properties.

For example in Linux:

CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=<heap_dump_file_path> ${CATALINA_OPTS}"

Next, reproduce the java.lang.OutOfMemoryError: Java Heap Space error.

The next time you have an out of memory error, a *.hprof file will be created that is approximately the size of your java heap, i.e. 1024m (according to the above example).

Please wait until it's completely written out (before restarting confluence) and attach a zip of this dump to your support case.

Please note that a large -Xmx may make it difficult to open the heap dump.


Memory settings

How to set the heap or permanent generation memory depends on your distribution, platform, and how you start Confluence. Refer to Configuring System Properties.

tip/resting Created with Sketch.

If you're starting Confluence from a Windows service, make sure you add the properties through the registry settings.

tip/resting Created with Sketch.

To verify if your settings have been picked up, check Displaying System Properties.

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.