Skip to content

Commit abcd770

Browse files
authored
Merge pull request #1635 from Sreekala-Gopakumar/1634SilentAdj
Adjustment of default maximum heap size based on initial size
2 parents f37c3aa + 35b9a4c commit abcd770

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docs/version0.53.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The following new features and notable changes since version 0.51.0 are included
3030
- [OpenSSL 3.5.1 is bundled on all platforms](#openssl-351-is-bundled-on-all-platforms)
3131
- [Offheap support is added for the `balanced` GC policy](#offheap-support-is-added-for-the-balanced-gc-policy)
3232
- ![Start of content that applies to Java 11 (LTS) and later](cr/java11plus.png) [New JDK Flight Recorder (JFR) events are added in this release](#new-jdk-flight-recorder-jfr-events-are-added-in-this-release) ![End of content that applies only to Java 11 and later](cr/java_close.png)
33+
- [The default maximum heap size is automatically adjusted based on the initial heap size](#the-default-maximum-heap-size-is-automatically-adjusted-based-on-the-initial-heap-size)
3334

3435
## Features and changes
3536

@@ -68,6 +69,12 @@ In this release, the following new JFR events are added:
6869

6970
For more information, see [`-XX:[+|-]FlightRecorder`](xxflightrecorder.md). ![End of content that applies only to Java 11 and later](cr/java_close.png)
7071

72+
### The default maximum heap size is automatically adjusted based on the initial heap size
73+
74+
If the maximum object heap size is not explicitly set with the `-Xmx` option and the VM uses the default value of `-Xmx`, then even if `-Xms` is greater than `-Xmx` initially, the VM starts successfully. The VM starts because the default `-Xmx` value is increased automatically to match `-Xms`.
75+
76+
Until the 0.53.0 release, if `-Xms` was greater than `-Xmx`, the VM used to fail. For more information, see [`-Xms` / `-Xmx`](xms.md).
77+
7178
## Known problems and full release information
7279

7380
To see known problems and a complete list of changes between Eclipse OpenJ9 v0.51.0 and v0.53.0 releases, see the [Release notes](https://github.com/eclipse-openj9/openj9/blob/master/doc/release-notes/0.53/0.53.md).

docs/xms.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
# -Xms / -Xmx
2525

2626

27-
These Oracle® HotSpot™ options set the initial/minimum Java™ heap size, and the maximum heap size respectively. These options are recognized by the Eclipse OpenJ9™ VM.
27+
The Oracle® HotSpot™ option `-Xms` sets the initial or the minimum Java™ heap size, and the `-Xmx` HotSpot option sets the maximum heap size. These options are recognized by the Eclipse OpenJ9™ VM.
2828

2929
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Notes:**
3030

31-
- If you set `-Xms` > `-Xmx`, the VM fails with the message `-Xms too large for -Xmx`.
31+
- If you set `-Xms` &gt; `-Xmx`, the VM fails with the message `-Xms too large for -Xmx`.<br>If you do not explicitly set the maximum object heap size with `-Xmx` and the VM uses the default value of `-Xmx`, then even if `-Xms` is greater than `-Xmx` initially, the VM starts successfully because the default `-Xmx` value is increased automatically to match `-Xms`.<br><br>For example, for a VM with 16 GB RAM, the default maximum size is 25% of RAM, therefore the default value of `Xmx` will be 4 GB. If the initial size is specified as 6 GB (`-Xms6g`), then `-Xms` (6 GB) is greater than `-Xmx` (4 GB) and before the 0.53.0 release that VM used to fail. But now with current adjustment, the default maximum heap size is increased automatically to 6 GB and the VM starts. This change in behavior was added from the 0.53.0 release onwards.
3232
- If you exceed the limit set by the `-Xmx` option, the VM generates an `OutofMemoryError`.
3333
- If you set a value for `-Xms`, the [`-XX:InitialRAMPercentage`](xxinitialrampercentage.md) option is ignored.
3434
- If you set a value for `-Xmx`, the [`-XX:MaxRAMPercentage`](xxinitialrampercentage.md) option is ignored.
@@ -62,11 +62,12 @@ The `-Xmx` option can be used with all OpenJ9 GC policies. However, the `-Xms` o
6262
: Heap starts at 50 MB and grows to the default maximum.
6363

6464
`-Xmx256m`
65-
: Heap starts at default initial value and grows to a maximum of 256 MB.
65+
: Heap starts at the default initial value and grows to a maximum of 256 MB.
6666

6767
## See also
6868

6969
- [-Xsoftmx (Set "soft" maximum Java heap size)](xsoftmx.md)
70+
- [What's new in version 0.53.0](version0.53.md#the-default-maximum-heap-size-is-automatically-adjusted-based-on-the-initial-heap-size)
7071

7172

7273

0 commit comments

Comments
 (0)