container support not enabled due to required cgroup subsystems not found

ashutosh mehra mehra.ashutosh at gmail.com
Thu Mar 15 13:57:02 UTC 2018


JDK 11 seems to be working fine. It detects container memory limit and sets
the heap size accordingly.

Regards,
Ashutosh

On Thu, Mar 15, 2018 at 7:16 PM, ashutosh mehra <mehra.ashutosh at gmail.com>
wrote:

> I am assuming you would be interested in only cgroup related mount points
> in /proc/self/mountinfo:
>
> 25 18 0:20 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:8 - tmpfs tmpfs
> ro,seclabel,mode=755
> 26 25 0:21 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime
> shared:9 - cgroup cgroup rw,xattr,release_agent=/usr/
> lib/systemd/systemd-cgroups-agent,name=systemd
> 28 25 0:23 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime
> shared:10 - cgroup cgroup rw,cpuacct,cpu
> 29 25 0:24 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime
> shared:11 - cgroup cgroup rw,memory
> 30 25 0:25 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime
> shared:12 - cgroup cgroup rw,hugetlb
> 31 25 0:26 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime
> shared:13 - cgroup cgroup rw,cpuset
> 32 25 0:27 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime
> shared:14 - cgroup cgroup rw,perf_event
> 33 25 0:28 / /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime
> shared:15 - cgroup cgroup rw,net_prio,net_cls
> 34 25 0:29 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime
> shared:16 - cgroup cgroup rw,blkio
> 35 25 0:30 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime
> shared:17 - cgroup cgroup rw,freezer
> 36 25 0:31 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime
> shared:18 - cgroup cgroup rw,devices
> 37 25 0:32 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime
> shared:19 - cgroup cgroup rw,pids
>
> Linux distro is RHEL Workstation 7.4
> Kernel level - 3.10.0-693.17.1.el7.x86_64
>
> I have cgroup v1.
>
> I will check with Java 11 as well.
>
> Regards,
> Ashutosh
>
> On Thu, Mar 15, 2018 at 6:22 PM, Bob Vandette <bob.vandette at oracle.com>
> wrote:
>
>> Yes, please send us the contents of /proc/self/mountinfo.
>>
>> What Linux operating system distro are you running?  What kernel version?
>>
>> You might want to try the JDK 11 Early Access build.  It provides a bit
>> more logging for container detection.
>> You will at least see which subsystem was not located.
>>
>> http://jdk.java.net/11/
>>
>> Are you running cgroups version 1 or 2?
>>
>>
>> Bob.
>>
>>
>> > On Mar 15, 2018, at 8:27 AM, David Holmes <david.holmes at oracle.com>
>> wrote:
>> >
>> > Moving to hotspot-dev
>> >
>> > On 15/03/2018 8:51 PM, ashutosh mehra wrote:
>> >> When I run  jdk-10+46 build in a docker container, I don't see
>> MaxHeapSize
>> >> being adjusted based on container memory limit.
>> >> Command to run docker container with 2G memory, 2 CPUs:
>> >> $ docker run -m2g --memory-swap=2g --cpus=2 -it --rm -v
>> >> /home/ashu/data/builds/openjdk/jdk-10+46:/root/jdk-10 ubuntu:16.04
>> >> Once inside the container ran the following command:
>> >> # /root/jdk-10//bin/java -XX:+UnlockDiagnosticVMOptions
>> >> -XX:+PrintFlagsFinal -version | grep MaxHeapSize
>> >> Output:
>> >>    size_t MaxHeapSize                              = 2015363072
>> >>                    {product} {ergonomic}
>> >> openjdk version "10" 2018-03-20
>> >> OpenJDK Runtime Environment 18.3 (build 10+46)
>> >> OpenJDK 64-Bit Server VM 18.3 (build 10+46, mixed mode)
>> >> When I used -Xlog:os+container=trace option, I get following
>> information:
>> >> # /root/jdk-10//bin/java "-Xlog:os+container=trace" -version
>> >> [0.001s][trace][os,container] OSContainer::init: Initializing Container
>> >> Support
>> >> [0.001s][debug][os,container] Required cgroup subsystems not found
>> >> openjdk version "10" 2018-03-20
>> >> OpenJDK Runtime Environment 18.3 (build 10+46)
>> >> OpenJDK 64-Bit Server VM 18.3 (build 10+46, mixed mode)
>> >> Following subsystems are present in the docker container:
>> >> # ls /sys/fs/cgroup/
>> >> blkio  cpu  cpuacct  cpuacct,cpu  cpuset  devices  freezer  hugetlb
>> >> memory  net_cls  net_prio  net_prio,net_cls  perf_event  pids  systemd
>> >> As far as I understand, JVM is using only memory, cpu and cpuset
>> subsystems
>> >> which are present in my system. Not sure why is it reporting "Required
>> >> cgroup subsystems not found".
>> >> Any idea what could be wrong here? Are there other debug options to
>> figure
>> >> out what is going wrong?
>> >
>> > What does /proc/self/mountinfo show?
>> >
>> > David
>> >
>> >> Regards,
>> >> Ashutosh Mehra
>>
>>
>


More information about the hotspot-dev mailing list