Can someone please explain what the JVM option ReservedCodeCacheSize and InitialCodeCacheSize are? Specifically when/why would I want to change it? How do I decide what the right size is?
This is what the docs say:
-XX:ReservedCodeCacheSize=32m Reserved code cache size (in bytes) – maximum code cache size. [Solaris 64-bit, amd64, and -server x86: 2048m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.]
ReservedCodeCacheSize(andInitialCodeCacheSize) is an option for the (just-in-time) compiler of the Java Hotspot VM. Basically it sets the maximum size for the compiler’s code cache.The cache can become full, which results in warnings like the following:
It’s much worse when followed by
Java HotSpot(TM) Client VM warning: Exception java.lang.OutOfMemoryError occurred dispatching signal SIGINT to handler- the VM may need to be forcibly terminated.When to set this option?
Normally you’d not change this value. I think the default values are quite good balanced because this problems occur on very rare occasions only (in my experince).