JDK-8239785 : Cgroups: Incorrect detection logic on old systems in hotspot
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2020-02-21
  • Updated: 2022-12-13
  • Resolved: 2020-03-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 15 JDK 8 Other
11.0.16Fixed 15 b15Fixed 8u371Fixed openjdk8u372Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
This bug is similar to JDK-8239559, but for hotspot's cgroup version detection heuristic. Currently on old systems it prints this (even though this is cgroups v1):

./images/jdk/bin/java -Xlog:os+container=trace -version
[0.004s][trace][os,container] OSContainer::init: Initializing Container Support
[0.005s][trace][os,container] Mount point for cgroupv2 not found in /proc/self/mountinfo
openjdk version "15.0.0.1-internal" 2020-02-20

This used to be:
# java -Xlog:os+container=trace -version
[0.000s][trace][os,container] OSContainer::init: Initializing Container Support
[0.001s][debug][os,container] Required cgroup memory subsystem not found
Comments
Fix Request (8u) Please consider this for jdk8u-dev as part of cgroups v2 support. Thank you
09-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/135 Date: 2022-10-12 10:19:37 +0000
12-10-2022

Fix request (11u) Please consider this backport to 11u as part of adding cgroups v2 support. The patch was clean except for one copyright line in src/hotspot/share/prims/whitebox.hpp. Thanks
25-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/946 Date: 2022-03-25 10:17:45 +0000
25-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/881 Date: 2022-03-11 11:04:45 +0000
11-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/880 Date: 2022-03-11 10:56:27 +0000
11-03-2022

URL: https://hg.openjdk.java.net/jdk/jdk/rev/d527da8f8f9b User: sgehwolf Date: 2020-03-12 13:45:37 +0000
12-03-2020

RFR: http://mail.openjdk.java.net/pipermail/hotspot-dev/2020-February/040978.html
25-02-2020

ILW = MMH = P3
25-02-2020

The suggested fix is to not continue if no cgroup controllers are mounted. There's no point to (host values will be used instead) and the misleading cgroup v2 detection message is gone.
25-02-2020

Candidate webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8239785/01/webrev/
25-02-2020