Configuring large page memory allocation

You can enable large page support, on systems that support it, by starting Java™ with the -Xlp option. 1M pageable pages, when available, are the default size for the object heap and code cache.

About this task

Large page usage is primarily intended to provide performance improvements to applications that allocate a great deal of memory and frequently access that memory. The large page performance improvements are a result of the reduced number of misses in the Translation Lookaside Buffer (TLB). The TLB maps a larger virtual storage area range and thus causes this improvement.

Sub-options are available to request the JVM to allocate the Java object heap or the JIT code cache using large pages. These options are shown in the table, together with the large page sizes supported.
Table 1. Large page size support. Large page sizes supported for -Xlp options
Large page size -Xlp:codecache -Xlp:objectheap -Xlp
2G nonpageable Not supported Supported (64-bit JVM only) Supported (64-bit JVM only)
1M nonpageable Not supported Supported (64-bit JVM only) Supported (64-bit JVM only)
1M pageable Supported (31-bit and 64-bit JVM) Supported (31-bit and 64-bit JVM) Not supported

For more information about the -Xlp options, see JVM command-line options.

The following restrictions apply to large page sizes on z/OS®:
2G nonpageable
  • This page size applies to object heap large pages. The JIT code cache cannot be allocated in 2GB nonpageable large pages.
  • This page size is supported only on the 64-bit SDK for z/OS, not the 31-bit SDK.
  • This page size requires z/OS V1.13 with PTFs and the z/OS V1.13 Remote Storage Manager Enablement Offering web deliverable, and an IBM® zEnterprise® EC12 processor or later.
  • A system programmer must configure z/OS for 2G nonpageable large pages.
  • Users who require large pages must be authorized to the IARRSM.LRGPAGES resource in the RACF® (or an equivalent security product) FACILITY class with read authority.
1M nonpageable
  • This page size applies to object heap large pages. The JIT code cache cannot be allocated in 1M nonpageable large pages.
  • This page size is supported only on the 64-bit SDK for z/OS, not the 31-bit SDK.
  • This page size requires z/OS V1.10 or later with APAR OA25485, and a System z10® processor or later.
  • A system programmer must configure z/OS for 1M nonpageable large pages.
  • Users who require large pages must be authorized to the IARRSM.LRGPAGES resource in the RACF (or an equivalent security product) FACILITY class with read authority.
1M pageable
  • This page size is supported on the 31-bit and 64-bit SDK for z/OS.
  • Both the object heap and the JIT code cache can be allocated in 1M pageable large pages.
  • The use of 1M pageable pages for the object heap provides similar runtime performance benefits to the use of 1M nonpageable pages. In addition, using 1M pageable pages provides options for managing memory that can improve system availability and responsiveness.
  • The following minimum prerequisites apply: IBM zEnterprise EC12 with the Flash Express® feature (#0402), z/OS V1.13 with APAR OA41307, and the z/OS V1.13 Remote Storage Manager Enablement Offering web deliverable.
  • 1M pageable, when available, is the default page size for the object heap and the code cache.
Warning: Specifying -Xlp or -Xlp1m utilizes nonpageable pages instead of pageable pages for the object heap, which might result in higher real memory usage.
When the JVM is allocating large pages, if a particular large page size cannot be allocated, the following sizes are attempted, in order, where applicable:
  • 2G nonpageable
  • 1M nonpageable
  • 1M pageable
  • 4K pageable
For example, if 1M nonpageable large pages are requested but cannot be allocated, pageable 1M large pages are attempted, and then pageable 4K pages.

The option PAGESCM=ALL | NONE in the IEASYSxx parmlib member controls 1M pageable large pages for the entire LPAR. ALL is the default. Therefore, when running on a system that has Flash cards installed, and using a z/OS system that supports Flash, the Flash card is available for paging by default. As a result, RSM also allows the use of 1M pageable large pages.

The option LFAREA in the IEASYxx parmlib member controls both 2G nonpageable and 1M nonpageable large pages for the entire LPAR. You can use the z/OS system command DISPLAY VS,LFAREA to show LFAREA usage information for the entire LPAR. For more information, see LFAREA in the z/OS product documentation.

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

Specifying an object heap size that is a multiple of the page size uses another page of memory. For example, if the page size is 2 GB, setting -Xmx2G actually uses 4 GB of memory. To avoid using more memory, make the heap size a little smaller than an integral number of pages by subtracting at least 16 bytes. For example, when you use a 2 GB page size, specify a maximum heap size of -Xmx2147483632 (2147483648 minus 16 bytes) instead of -Xmx2048m (2 GB). If you use a 4 GB page size, specify a heap size of -Xmx4294967280 (4,294,967,296 minus 16 bytes) instead of -Xmx4096m (4 GB), and so on.

Specifying an object heap size that is a multiple of the page size uses another page of memory. For example, if the page size is 2G, setting -Xmx2G actually uses 4G of memory. To avoid using more memory, make the heap size a little smaller than an integral number of pages by subtracting at least 16 bytes. For example, when you use a 2G page size, specify a maximum heap size of -Xmx2147483632 (2147483648 minus 16 bytes) instead of -Xmx2048m (2G). If you use a 4G page size, specify a heap size of -Xmx4294967280 (4,294,967,296 minus 16 bytes) instead of -Xmx4096m (4G), and so on.

When requesting nonpageable large pages, the real memory size that you specify is allocated when the JVM starts. For example, to allocate 1G of real memory by using 1M nonpageable pages when the JVM starts, set the following options:
  • -Xmx1023m -Xms512m -Xlp:objectheap:pagesize=1M,nonpageable

The physical storage that is allocated for the object heap is allocated in increments of the page size. For example, if you use 2G large pages with the options -Xmx1024M and -Xms512K, the object heap is allocated on a 2G large page. The real memory for the 2G large page is allocated immediately. Even though the object heap is consuming a 2G large page in this example, the maximum object heap is still 1M with an initial Java heap of 512K, as specified. If the 2G pagesize is not pageable, the 2G large page is never paged out as long as the JVM is running.

For more information about the -Xmx option, see Garbage Collector command-line options.