Confluence Crashes Due to CodeCache in JVM Becoming Full

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

The following appears in the atlassian-confluence.log:

1 Caused by: java.lang.VirtualMachineError: out of space in CodeCache for adapters

Diagnosis

The instance will have crashed, locked up or frozen, but once restarted the instance will continue to perform normally until the next freeze/hang/crash.

Cause

The reason this occurs isn't clear, but the problem is that the CodeCache of the JVM becomes full and as a result the JVM locks up and the instance will crash.

Solution

Resolution

  • Add the following argument to the Java startup options by following Configuring System Properties.

    1 -XX:+UseCodeCacheFlushing
  • Restart the application to initialise the new configuration.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.