Full CodeCache causes Jira to crash or perform slowly

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

The instance may crash, become slow, or become unresponsive.

The following entries can be found in the atlassian-jira.log:

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=

Note: An instance might still be impacted by this issue even when the above error is not present in the logs.


The following appears on the thread dumps where the compiler threads would be in the runnable state and consuming CPU.

Note: In JDK 1.8 and above these threads are no longer present 

"C2 CompilerThread0" #6 daemon prio=5 tid=0x000000001ab9c000 nid=0xcfc runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE


The following may also appear and seems to affect the majority of every running thread:

                at org.terracotta.statistics.jsr166e.LongAdder.add(LongAdder.java:62)
                at org.terracotta.statistics.jsr166e.LongAdder.increment(LongAdder.java:76)
                at org.terracotta.statistics.GeneralOperationStatistic.end(GeneralOperationStatistic.java:71)
                at net.sf.ehcache.constructs.blocking.BlockingCache.get(BlockingCache.java:176)
                at com.atlassian.cache.ehcache.LoadingCache.get(LoadingCache.java:120)
                at com.atlassian.cache.ehcache.DelegatingCache.get(DelegatingCache.java:107)
                at com.atlassian.cache.impl.metrics.InstrumentedCache.get(InstrumentedCache.java:72)
                at com.atlassian.jira.cache.stats.CacheWithStats.get(CacheWithStats.java:46)
                at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.resolve(CachingOfBizPropertyEntryStore.java:126)
                at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.getEntry(CachingOfBizPropertyEntryStore.java:151)
                at com.atlassian.jira.propertyset.CachingOfBizPropertySet.get(CachingOfBizPropertySet.java:189)

Environment

All versions of Jira Data Center

Cause

This issue can occasionally happen when the Java CodeCache becomes full.

Resolution

  1. Modify setenv.sh or setenv.bat accordingly ( if you've already increased to 1024m, increase to 2048m )

    # The following setting configures the size of JVM code cache.  A high value of reserved size allows Jira to work with more installed apps.
    #
    JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=1024m'
  2. Clear catalina.out log file under <JIRA_INSTALL>/logs directory because the health check may be responding to outdated messages in catalina.out.
  3. Restart the application for the new settings to take effect.





Last modified on Feb 7, 2025

Was this helpful?

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