Skip to content

Commit

Permalink
Code cache allocation changes with Large pages enabled
Browse files Browse the repository at this point in the history
eclipse-openj9#1206

Updated the related topics with the information of the change in the large page memory allocation behavior.

Closes eclipse-openj9#1206
Signed-off-by: Sreekala Gopakumar <[email protected]>
  • Loading branch information
Sreekala-Gopakumar committed Jan 9, 2024
1 parent e5424a6 commit 045b666
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ Some Linux kernels implement Transparent HugePage Support (THP), which automates
- The `-Xlp:objectheap` option requests that the Java object heap is allocated by using large pages.
- The `-Xlp:codecache` option requests that the JIT code cache is allocated by using large pages.

If the configured large page size is greater than the size of the total JIT code cache, the next available lower page size on the platform is used for the code cache allocation.

You must also enable large pages on your local system. This process differs according to the operating system.

### AIX systems
Expand Down
13 changes: 11 additions & 2 deletions docs/version0.43.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The following new features and notable changes since version 0.42.0 are included

- [New binaries and changes to supported environments](#binaries-and-supported-environments)
- [Compiler changes for Linux&reg;](#compiler-changes-for-linux)
- [Change in the large page memory allocation behavior](#change-in-the-large-page-memory-allocation-behavior)

## Features and changes

Expand All @@ -42,9 +43,17 @@ To learn more about support for OpenJ9 releases, including OpenJDK levels and pl

Linux x86 64-bit, Linux on POWER&reg; LE 64-bit, and Linux on IBM Z&reg; 64-bit builds on OpenJDK 8, 11, and 17 now use gcc 11.2 compiler. Linux AArch64 64-bit moved to gcc 10.3 compiler from gcc 7.5 compiler on OpenJDK 8 and 11.

On OpenJDK 19 and later, Linux reference compiler was already updated to gcc 11.2 in [release 0.37.0](version0.37.md).
On OpenJDK 19 and later, the Linux reference compiler was already updated to gcc 11.2 in [release 0.37.0](version0.37.md).

See [Supported environments](openj9_support.md).
For more information, see [Supported environments](openj9_support.md).

### Change in the large page memory allocation behavior

Earlier, the JIT code cache was allocated memory as a multiple of the available page size even if the configured large page size was greater than the total JIT code cache size.

Now, 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 platform is used for the code cache allocation.

For more information, see [`-Xlp:codecache`](xlpcodecache.md).

## Known problems and full release information

Expand Down
10 changes: 8 additions & 2 deletions docs/xlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ Requests the Eclipse OpenJ9&trade; VM to allocate the Java&trade; object heap an

If you use the [`-Xgc:preferredHeapBase`](xgc.md#preferredheapbase) option with `-Xlp`, the preferredHeapBase address must be a multiple of the large page size. If you specify an inaccurate heap base address, the heap is allocated with the default page size.

To find out the large page sizes available and the current setting, use the `-verbose:sizes` option. Note that the current settings are the requested sizes and not the sizes obtained. For object heap size information, check the `-verbose:gc` output.
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.

Configuring the large page memory allocation after you enable the large page support is different in different platforms. For more information, see [Configuring large page memory allocation](configuring.md#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 platform is identified and used for the code cache allocation.

For example, if the large page size is configured as 1 GB and the total JIT code cache size is not modified (by using the [`-Xcodecachetotal`](xcodecachetotal.md) option), then the code cache size will be the default JIT code cache size, 256 MB (for a 64-bit VM). Thus, the next available page size lower than 256 MB is used for code cache allocation. If the next available lower size page size is 2 MB, then 128 pages (of 2 MB each) are allocated for the code cache.

## Syntax

-Xlp[<size>]

See [Using -X command-line options](x_jvm_commands.md) for more information about the `<size>` parameter.
For more information about the `<size>` parameter, see [Using -X command-line options](x_jvm_commands.md).

## Explanation

Expand Down
12 changes: 9 additions & 3 deletions docs/xlpcodecache.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ Requests the Eclipse OpenJ9&trade; VM to allocate the JIT code cache by using la

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. Note that the current settings are the requested sizes and not the sizes obtained. For object heap size information, check the `-verbose:gc` output.
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.

Configuring the large page memory allocation after you enable the large page support is different in different platforms. For more information, see [Configuring large page memory allocation](configuring.md#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 platform is identified and used for the code cache allocation.

For example, if the large page size is configured as 1 GB and the total JIT code cache size is not modified (by using the [`-Xcodecachetotal`](xcodecachetotal.md) option), then the code cache size will be the default JIT code cache size, 256 MB (for a 64-bit VM). Thus, the next available page size lower than 256 MB is used for code cache allocation. If the next available lower size page size is 2 MB, then 128 pages (of 2 MB each) are allocated for the code cache.

## Syntax

Expand All @@ -39,7 +45,7 @@ z/OS&reg;:

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

See [Using -X command-line options](x_jvm_commands.md) for more information about the `<size>` parameter.
For more information about the `<size>` parameter, see [Using -X command-line options](x_jvm_commands.md).

## Default values

Expand Down Expand Up @@ -70,7 +76,7 @@ See [Using -X command-line options](x_jvm_commands.md) for more information abou

## See also

- [Configuring large page memory allocation](configuring.md#configuring-large-page-memory-allocation).
- [Configuring large page memory allocation](configuring.md#configuring-large-page-memory-allocation)



Expand Down

0 comments on commit 045b666

Please sign in to comment.