Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit www.eclipse.org/openj9/docs

-XdynamicHeapAdjustment

Linux® on x86, Linux on IBM Power® systems, Linux on AArch64 and Linux on IBM Z® systems (64-bit only)

Java 11 (LTS) and later This option enables a VM capability that automatically adjusts the maximum Java heap size (-Xmx) and minimum Java heap size (-Xms) values such that they are within the physical memory limitations on the system.

Syntax

    -XdynamicHeapAdjustment

The option is disabled by default. After it is enabled, the option cannot be disabled.

Explanation

Large -Xmx or -Xms values can cause problems or errors. If the -Xmx value is set larger than the available memory, errors, such as Out of memory error, excessive paging, or a bus error, might occur. If the -Xms value is set larger than the available memory or the soft maximum size of the cache (-Xsoftmx), an unrecoverable error occurs.

The -XdynamicHeapAdjustment option can be used to auto adjust the system, and avoid potential problems because of too large -Xmx or -Xms values. If the -Xmx or -Xms values are specified together with the -XdynamicHeapAdjustment option, VM automatically picks a size for -Xmx and -Xms that is within the limits of the available memory on the system. Typically, this size is 75% of the available memory.

For example, if the system has 8 GB memory but -Xmx is set to 12 GB, then the VM sets the value of xsoftmx, 6 GB, as the default maximum size of the heap.

Restrictions:

  • You can specify the -XdynamicHeapAdjustment option only at checkpoint time, and it applies to both checkpoint and restore.
  • The -XdynamicHeapAdjustment option can be used only with the -XX:+EnableCRIUSuport option.

End of content that applies only to Java 11 and later

See also