CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit


Use this option to tune performance.

This option sets the size of each block of memory that is allocated to store the native code of compiled Java™ methods. By default, this size is selected internally according to the processor architecture and the capability of your system. The maximum value you can specify is 32 MB. If you set a value larger than 32 MB, the JIT ignores the input and sets the value to 32 MB.

Note: The JIT compiler might allocate more than one code cache for an application. Use the -Xcodecachetotal option to set the maximum amount of memory that is used by all code caches.


See Using -X command-line options for more information about specifying the <size> parameter.