Use this option to set the maximum size limit for the JIT code cache. This option also affects the size of the JIT data cache.
The default size is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM.
See Using -X command-line options for more information about specifying the
By default, the total JIT code cache size is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM or 25% of the physical memory available to the VM process, whichever is lesser. Long-running, complex, server-type applications can fill the JIT code cache, which can cause performance problems because not all of the important methods can be JIT-compiled. Use the
-Xcodecachetotal option to increase or decrease the maximum code cache size to a setting that suits your application. The minimum size of the code cache is restricted to 2 MB.
The value that you specify is rounded up to a multiple of the code cache block size, as specified by the -Xcodecache option. If you specify a value for the
-Xcodecachetotal option that is smaller than the default setting, that value is ignored.
When you use this option, the maximum size limit for the JIT data cache, which holds metadata about compiled methods, is increased or decreased proportionally to support the JIT compilations.
The maximum size limits, for both the JIT code and data caches, that are in use by the VM are shown in Javadump output. Look for lines that begin with
1STSEGLIMIT. Use this information together with verbose JIT tracing to determine suitable values for this option on your system. For example Javadump output, see Java dump: Storage Management (MEMINFO).