Skip to content

-XX:InitialRAMPercentage / -XX:MaxRAMPercentage

These Oracle HotSpot options can be used to specify the initial and maximum size of the Java heap as a percentage of the total memory available to the VM. The options are recognized by Eclipse OpenJ9™ and provided for compatibility.

Syntax

Setting Effect
-XX:InitialRAMPercentage=N Set initial heap size as a percentage of total memory
-XX:MaxRAMPercentage=N Set maximum heap size as a percentage of total memory
Where N is a value between 0 and 100, which can be of type "double". For example, 12.3456.

Note: If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored. If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored.

If your application is running in a container and you have specified -XX:+UseContainerSupport, both the default heap size for containers, the -XX:InitialRAMPercentage option, and the -XX:MaxRAMPercentage option are based on the available container memory.