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

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only. This article only applies to Atlassian products on the server and data center platforms.

Problem

The instance may crash, become slow or unresponsive.

The following appears in catalina.out

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

top -n1 -b -H

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

"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:

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

Last modified on Nov 2, 2018

Was this helpful?

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