Skip to content

Commit 836fa6d

Browse files
authored
Merge pull request #1591 from Sreekala-Gopakumar/1584XXCpuLoad
-XX:[+|-]CpuLoadCompatibility Documentation Updates
2 parents 74e1226 + be3767e commit 836fa6d

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

docs/version0.56.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!--
2+
* Copyright (c) 2017, 2025 IBM Corp. and others
3+
*
4+
* This program and the accompanying materials are made
5+
* available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/ or the Apache
8+
* License, Version 2.0 which accompanies this distribution and
9+
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10+
*
11+
* This Source Code may also be made available under the
12+
* following Secondary Licenses when the conditions for such
13+
* availability set forth in the Eclipse Public License, v. 2.0
14+
* are satisfied: GNU General Public License, version 2 with
15+
* the GNU Classpath Exception [1] and GNU General Public
16+
* License, version 2 with the OpenJDK Assembly Exception [2].
17+
*
18+
* [1] https://www.gnu.org/software/classpath/license.html
19+
* [2] https://openjdk.org/legal/assembly-exception.html
20+
*
21+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
22+
-->
23+
24+
# What's new in version 0.56.0
25+
26+
The following new features and notable changes since version 0.55.0 are included in this release:
27+
28+
- [New binaries and changes to supported environments](#binaries-and-supported-environments)
29+
- [Change in the `getCpuLoad()` method return value based on the platform](#change-in-the-getcpuload-method-return-value-based-on-the-platform)
30+
31+
## Features and changes
32+
33+
### Binaries and supported environments
34+
35+
Eclipse OpenJ9&trade; release 0.56.0 supports OpenJDK 8, 11, 17, 21, and 25.
36+
37+
To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see [Supported environments](openj9_support.md).
38+
39+
### Change in the `getCpuLoad()` method return value based on the platform
40+
41+
In all platforms except z/OS&reg;, if the `-XX:+CpuLoadCompatibility` option is set to enable the OpenJDK behavior of the `getProcessCpuLoad()` and `getCpuLoad()` methods in OpenJ9, the `getCpuLoad()` method now collects two internal samples so that a valid CPU usage value can be returned instead of `0` return value on the first call.
42+
43+
On z/OS, the CPU load that is reported by the `getCpuLoad` method is obtained directly from the system control blocks, without the need to collect samples. The `-XX:[+|-]CpuLoadCompatibility` option has no effect on z/OS, and a valid CPU usage value is always returned whatever be the setting of this option.
44+
45+
For more information, [`-XX:[+|-]CpuLoadCompatibility`](xxcpuloadcompatibility.md).
46+
47+
## Known problems and full release information
48+
49+
To see known problems and a complete list of changes between Eclipse OpenJ9 v0.55.0 and v0.56.0 releases, see the [Release notes](https://github.com/eclipse-openj9/openj9/blob/master/doc/release-notes/0.56/0.56.md).
50+
51+
<!-- ==== END OF TOPIC ==== version0.56.md ==== -->

docs/xxcpuloadcompatibility.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323

2424
# -XX:[+|-]CpuLoadCompatibility
2525

26-
This option enables or disables the OpenJDK behavior of the `getProcessCpuLoad()` and `getSystemCpuLoad()` methods in OpenJ9.
26+
This option enables or disables the OpenJDK behavior of the `getProcessCpuLoad()` and `getCpuLoad()` methods in OpenJ9.
27+
28+
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Note:** Before OpenJDK 14, the `getCpuLoad()` method name was `getSystemCpuLoad()`. Because OpenJDK 14 is no longer supported, the relevant LTS release where this change is visible is OpenJDK 17 and later.
2729

2830
## Syntax
2931

@@ -36,14 +38,17 @@ This option enables or disables the OpenJDK behavior of the `getProcessCpuLoad()
3638

3739
## Explanation
3840

39-
The `getProcessCpuLoad()` method in the `com.sun.management.OperatingSystemMXBean` class returns the recent CPU usage value for the Java virtual machine process, while the `getSystemCpuLoad()` method returns the recent CPU usage value for the whole system. When these methods were called in OpenJ9 for the first time, these methods were returning `-1` to indicate that the recent CPU usage is not available. It was difficult to identify whether the reason for the `-1` value was an error or because the call was the first call and therefore, no recent CPU usage was available.
41+
The `getProcessCpuLoad()` method in the `com.sun.management.OperatingSystemMXBean` class returns the recent CPU usage value for the Java virtual machine process, while the `getCpuLoad()` method returns the recent CPU usage value for the whole system. When these methods were called in OpenJ9 for the first time, these methods were returning `-1` to indicate that the recent CPU usage is not available. It was difficult to identify whether the reason for the `-1` value was an error or because the call was the first call and therefore, no recent CPU usage was available.
42+
43+
In OpenJDK, `getProcessCpuLoad()` returns `0` value on the first call, while `getCpuLoad()` collects two internal samples so that a valid CPU usage value can be returned. This `0` return value on the first call and the two internal samples make it easier to differentiate between the first call behavior and an error that needs further investigation.
4044

41-
In OpenJDK, these methods return `0` value in the case of the first call, which makes it easier to differentiate between the first call behavior and an error that needs further investigation.
45+
The `-XX:+CpuLoadCompatibility` option is used to enable the OpenJDK behavior of the `getProcessCpuLoad()` and `getCpuLoad()` methods in OpenJ9.
4246

43-
The `-XX:+CpuLoadCompatibility` option is used to enable the OpenJDK behavior of the `getProcessCpuLoad()` and `getSystemCpuLoad()` methods in OpenJ9.
47+
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Note:** The `-XX:[+|-]CpuLoadCompatibility` option is applicable to all platforms except z/OS&reg;. On z/OS, the CPU load that is reported by the `getCpuLoad` method is obtained directly from the system control blocks, without the need to collect samples. The `-XX:[+|-]CpuLoadCompatibility` option has no effect on z/OS, and a valid CPU usage value is always returned whatever be the setting of this option.
4448

4549
## See also
4650

4751
- [What's new in version 0.43.0](version0.43.md#new-xx-cpuloadcompatibility-option-added)
52+
- [What's new in version 0.56.0](version0.56.md#change-in-the-getcpuload-method-return-value-based-on-the-platform)
4853

4954
<!-- ==== END OF TOPIC ==== xxcpuloadcompatibility.md ==== -->

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ nav:
101101

102102
- "Release notes" :
103103
- "Overview" : openj9_releases.md
104+
- "Version 0.56.0" : version0.56.md
104105
- "Version 0.55.0" : version0.55.md
105106
- "Version 0.54.0" : version0.54.md
106107
- "Version 0.53.0" : version0.53.md

0 commit comments

Comments
 (0)