High JVM codecache utilization reported in production and in UAT
High JVM code cache utilization reported in production and in UAT environments. Introscope Wily monitoring system repots 97% code cache utilization.
No error messages present in the logs.
Java HotSpot(TM) 64-Bit Server VM
Java version 1.6.0_37
WebSphere Platform 22.214.171.124
Host Operating System:
SunOS, version 5.10
Steps to Reproduce
There is no specific use case to reproduce this issue.
The code cache is a memory area separate from the JVM heap that contains all the JVM bytecode for methods compiled into native code. On 64 bit VMs the reserved cache size is 48 MB. Default code cache size could be too small for complex applications and can be set higher if the application requires it. If the code cache overflows, default behavior is to switch to interpreted-only mode which increases the CPU usage and slows down the application.
To detect code cache size related issues check for the presence of the following messages in the application server logs:
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
To verify the code cache usage, use the JConsole tool provided with the JDK and then switch to the 'Memory' tab to find out the code cache size.
In order to do so add the following JVM options to the startup script of your application server.
This option tells the JVM to allocate 128 MBytes for the code cache
This option tells the JVM to clear some of the compiled code from the cache but continue to use it
100% found this useful