Confluence crashes due to CodeCache is full. Compiler has been disabled.

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

Problem

The instance may crash, become slow or unresponsive.

The following appears in catalina.out

1 2 3 4 5 6 Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled. Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize= CodeCache: size=245760Kb used=243892Kb max_used=243931Kb free=1867Kb bounds [0x00007faa3b170000, 0x00007faa4a170000, 0x00007faa4a170000] total_blobs=45719 nmethods=44096 adapters=1528 compilation: disabled (not enough contiguous free space left)

When reviewing thread dumps with the following top output

1 top -n1 -b -H

The thread dumps for the threads with high CPU % are linked to

1 2 "C2 CompilerThread0" daemon prio=10 tid=0x00007fde30e8c800 nid=0xc3e5 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE

Cause

This issue is rare but it can occasionally happen when the Java CodeCache becomes full. A full explanation of this issue can be read

We have also been seeing this value need to be increased when using Java 8.

Resolution

  1. Add the following arguments to the Java startup options by following the instructions on Setting Properties and Options on Startup:

    1 2 -XX:ReservedCodeCacheSize=384m -XX:+UseCodeCacheFlushing
  2. Restart the application for the new settings to take effect.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.