Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0.41) Update JVM_IsUseContainerSupport #18197

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Sep 25, 2023

Backport of #18185.

Currently, in comparison to the RI, OpenJ9 shows a different output for
-XshowSettings:system outside a container because our
JVM_IsUseContainerSupport implementation differs from the RI.

This PR matches the latest RI behaviour for JVM_IsUseContainerSupport.

The RI returns TRUE from JVM_IsUseContainerSupport IFF
-XX:+UseContainerSupport is specified. This option is enabled by
default.

Currently, we return TRUE from JVM_IsUseContainerSupport if
-XX:+UseContainerSupport is specified && we are inside a container.

The return value of JVM_IsUseContainerSupport determines the output
of -XshowSettings:system.

If JVM_IsUseContainerSupport returns FALSE, -XshowSettings:system has
the below output:

Operating System Metrics:
    No metrics available for this platform

If JVM_IsUseContainerSupport returns TRUE, -XshowSettings:system has
the below output:

Operating System Metrics:
    Provider: cgroupv2
    Effective CPU Count: 8
    CPU Period: -1
    CPU Quota: -1
    CPU Shares: -1
    List of Processors: N/A
    List of Effective Processors: N/A
    List of Memory Nodes: N/A
    List of Available Memory Nodes: N/A
    Memory Limit: Unlimited
    Memory Soft Limit: 0.00K
    Memory & Swap Limit: Unlimited
    Maximum Processes Limit: Unlimited

Port of #18185 for 0.41

Signed-off-by: Babneet Singh [email protected]

Currently, in comparison to the RI, OpenJ9 shows a different output for
-XshowSettings:system outside a container because our
JVM_IsUseContainerSupport implementation differs from the RI.

This PR matches the latest RI behaviour for JVM_IsUseContainerSupport.

The RI returns TRUE from JVM_IsUseContainerSupport IFF
-XX:+UseContainerSupport is specified. This option is enabled by
default.

Currently, we return TRUE from JVM_IsUseContainerSupport if
-XX:+UseContainerSupport is specified && we are inside a container.

The return value of JVM_IsUseContainerSupport determines the output
of -XshowSettings:system.

If JVM_IsUseContainerSupport returns FALSE, -XshowSettings:system has
the below output:

    Operating System Metrics:
        No metrics available for this platform

If JVM_IsUseContainerSupport returns TRUE, -XshowSettings:system has
the below output:

    Operating System Metrics:
        Provider: cgroupv2
        Effective CPU Count: 8
        CPU Period: -1
        CPU Quota: -1
        CPU Shares: -1
        List of Processors: N/A
        List of Effective Processors: N/A
        List of Memory Nodes: N/A
        List of Available Memory Nodes: N/A
        Memory Limit: Unlimited
        Memory Soft Limit: 0.00K
        Memory & Swap Limit: Unlimited
        Maximum Processes Limit: Unlimited

Signed-off-by: Babneet Singh <[email protected]>
@babsingh babsingh changed the title Update JVM_IsUseContainerSupport (0.41) Update JVM_IsUseContainerSupport Sep 25, 2023
@babsingh babsingh requested a review from pshipton September 25, 2023 20:59
@pshipton pshipton merged commit 3ede3b5 into eclipse-openj9:v0.41.0-release Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants