Skip to content

-Xlp:codecache

Requests the Eclipse OpenJ9™ VM to allocate the JIT code cache by using large page sizes.

If the requested large page size is not available, the VM starts, but the JIT code cache is allocated by using a platform-defined size. A warning is displayed when the requested page size is not available.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. These current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

To use the large pages in the VM, enable the large pages support on your local system. The process for enabling the large page support differs in different operating systems. For more information, see Configuring large page memory allocation.

If the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the system is identified and used for the code cache allocation.

For example, if 1 GB, 2 MB and 4 KB pages are available on a system, the VM checks the total size of the JIT code cache. If the total JIT code cache size is not modified (by using the -Xcodecachetotal option), then for a 64-bit VM, the JIT code cache size will be the default size, 256 MB. In this case, the VM does not use 1 GB pages for the code cache because the size of the page exceeds the total size of the code cache (256 MB for 64-bit systems). Thus, the next available page size lower than 256 MB is used for code cache allocation. In this example, the next available lower size page is 2 MB. 128 pages (of 2 MB each) are allocated for the code cache.

Syntax

AIX®, Linux®, macOS®, and Windows™:

    -Xlp:codecache:pagesize=<size>

z/OS®:

    -Xlp:codecache:pagesize=<size>,pageable

For more information about the <size> parameter, see Using -X command-line options.

Default values

AIX

The code cache page size is controlled by the DATAPSIZE setting of the LDR_CNTRL environment variable. The page size cannot be controlled by the -Xlp:codecache:pagesize=<size> option. Specifying any other page size results in a warning that the page size is not available. The -verbose:sizes output reflects the current operating system setting.

For more information about the LDR_CNTRL environment variable, see Configuring large page memory allocation: AIX systems.

Linux

The default size for the code cache depends on the architecture:

  • Linux on x86 and AMD64/EM64T systems: 2 MB large pages
  • Linux on IBM Z®: 1 MB large pages
  • Linux on Power Systems™: The code cache page size cannot be controlled by the -Xlp:codecache:pagesize=<size> option. Specifying any other page size results in a warning that the page size is not available. The -verbose:sizes output reflects the current operating system setting.
  • On other architectures, the VM uses the default operating system page size.

macOS

The default size for the code cache is 4 KB large pages.

z/OS

1 MB pageable pages, when available, are the default size for the code cache.

The -Xlp:codecache:pagesize=<size>,pageable option supports only a large page size of 1 MB pageable large pages. The use of 1 MB pageable large pages for the JIT code cache can improve the runtime performance of some Java™ applications. A page size of 4 KB can also be used.

See also