CodeCache is full. Compiler has been disabled.

Nabil Sayegh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2013

I'm getting "CodeCache is full. Compiler has been disabled" messages in the log.

I've read https://confluence.atlassian.com/pages/viewpage.action?pageId=314447083 and http://blogs.atlassian.com/2012/05/codecache-is-full-compiler-has-been-disabled/ -XX:+UseCodeCacheFlushing I still get these errors.

Any Idea what is causing such a huge amount of code?

Could it be the ScriptRunner? Isn't that continuously compiling groovy?

2 answers

1 accepted

2 votes
Answer accepted
Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2013

I don't know who is responsible for the code cache usage, but I raised the code cache to 256 MB and didn't have this errors anymore. Just add -XX:ReservedCodeCacheSize=256m to the JVM_REQUIRED_ARGS within your setenv.sh file.

Additionally I wrote a Script Runner service which logs the Code Cache Size to enable me to see the history:

log.info "Code Cache Usage: ${sun.management.ManagementFactory.getMemoryPoolMXBeans().find{it.getName()=='Code Cache'}.getUsage()}"

Maybe you want to reduce the ReservedCodeCacheSize after some time monitoring the logs.

Henning

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2013

Nice... alternatively you could use some monitoring tool that can use JMX to get this info and chart it etc. Maybe JavaMelody has it - although I don't think so.

5140883 March 25, 2020

Thanks for Henning Tietgens' answer! Please tell me how to use your script! Thanks!

Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2020

Save the script as a file in the script path and create a service like described here: https://scriptrunner.adaptavist.com/4.3.19/jira/services.html

Or, use jobs in newer versions of ScriptRunner: https://scriptrunner.adaptavist.com/latest/jira/ScriptJobs.html

2 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2013

We've done this to death... check https://answers.atlassian.com/questions/145062/permgen-problems-with-scriptrunner.

You may be using another version of groovy.

If not just bump the permgen and XX:ReservedCodeCacheSize as per the question above.

Suggest an answer

Log in or Sign up to answer