Full CodeCache causes Jira server to crash or perform slowly
The instance may crash, become slow or unresponsive. The following entries can be found in the
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=
PS : An instance might still be impacted by this issue even when the above error is not showing up in the logs.
The following appears on the thread dumps where the compiler threads would be in runnable state and consuming CPU.
"C2 CompilerThread0" #6 daemon prio=5 tid=0x000000001ab9c000 nid=0xcfc runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE
This issue is rare but it can occasionally happen when the Java CodeCache becomes full. A full explanation of this issue can be read here. We have also been seeing this value need to be increased when using Java 8 and JIRA 6.3+.
Starting from Jira 7.13, the following properties are in the
.bat file by default. This should solve the problems with the code cache in most environments. We've specified the reserved size as 512m. If you're still getting this error, try increasing the size even more.
On larger JIRA instances it may be necessary to increase CodeCache further. We have yet to experience any consequences because of this besides the use of more system memory.
- Restart the application for the new settings to take effect.