Skip to content

Commit 025a660

Browse files
Documentation for -XX:[+/-]CpuLoadCompatibility
eclipse-openj9#1232 Created a new topic for -XX:[+/-]CpuLoadCompatibility. Updated the What's new in version 0.43.0 and mkdocs.yml file Closes eclipse-openj9#1232 Signed-off-by: Sreekala Gopakumar <[email protected]>
1 parent cc4b2fc commit 025a660

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

docs/version0.43.md

Lines changed: 11 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.42.0 are included
3030
- [Change in the large page memory allocation behavior](#change-in-the-large-page-memory-allocation-behavior)
3131
- ![Start of content that applies to Java 11 (LTS) and later](cr/java11plus.png) [New `-XX:[+|-]CRIUSecProvider` option added](#new-xx-criusecprovider-option-added) ![End of content that applies to Java 11 (LTS) and later](cr/java_close.png)
3232
- [New `-XX:Compatibility` option added](#new-xxcompatibility-option-added)
33+
- [New `-XX:[+|-]CpuLoadCompatibility` option added](#new-xx-cpuloadcompatibility-option-added)
3334

3435
## Features and changes
3536

@@ -73,6 +74,16 @@ In release 0.43.0, the compatibility mode is provided for the Elasticsearch appl
7374

7475
For more information, see [`-XX:Compatibility`](xxcompatibility.md).
7576

77+
### New `-XX:[+|-]CpuLoadCompatibility` option added
78+
79+
The `getProcessCpuLoad()` and `getSystemCpuLoad()` methods were returning `-1` to indicate that the recent CPU usage is not available when these methods were called in OpenJ9 for the first time. 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.
80+
81+
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.
82+
83+
The `-XX:+CpuLoadCompatibility` option is used to enable the OpenJDK behavior of the `getProcessCpuLoad()` and `getSystemCpuLoad()` methods in OpenJ9 so that these methods return `0` when called in OpenJ9 for the first time.
84+
85+
For more information, see [`-XX:[+|-]CpuLoadCompatibility`](xxcpuloadcompatibility.md).
86+
7687
## Known problems and full release information
7788

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

docs/xxcpuloadcompatibility.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
* Copyright (c) 2017, 2024 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+
# -XX:[+|-]CpuLoadCompatibility
25+
26+
This option enables or disables the OpenJDK behavior of the `getProcessCpuLoad()` and `getSystemCpuLoad()` methods in OpenJ9.
27+
28+
## Syntax
29+
30+
-XX:[+|-]CpuLoadCompatibility
31+
32+
| Setting | Effect | Default |
33+
|-----------------------|---------|:----------------------------------------------------------------------------------:|
34+
| `-XX:+CpuLoadCompatibility` | Enable | :fontawesome-solid-check:{: .yes aria-hidden="true"}<span class="sr-only">yes</span> |
35+
| `-XX:-CpuLoadCompatibility` | Disable | |
36+
37+
## Explanation
38+
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.
40+
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.
42+
43+
The `-XX:+CpuLoadCompatibility` option is used to enable the OpenJDK behavior of the `getProcessCpuLoad()` and `getSystemCpuLoad()` methods in OpenJ9.
44+
45+
46+
47+
<!-- ==== END OF TOPIC ==== xxcpuloadcompatibility.md ==== -->

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ nav:
388388
- "-XX:codecachetotalMaxRAMPercentage" : xxcodecachetotalmaxrampercentage.md
389389
- "-XX:[+|-]CompactStrings" : xxcompactstrings.md
390390
- "-XX:ContinuationCache" : xxcontinuationcache.md
391+
- "-XX:[+|-]CpuLoadCompatibility" : xxcpuloadcompatibility.md
391392
- "-XX:DiagnoseSyncOnValueBasedClasses" : xxdiagnosesynconvaluebasedclasses.md
392393
- "-XX:[+|-]DisableExplicitGC" : xxdisableexplicitgc.md
393394
- "-XX:[+|-]DisclaimJitScratch" : xxdisclaimjitscratch.md

0 commit comments

Comments
 (0)