container support not enabled due to required cgroup subsystems not found

ashutosh mehra mehra.ashutosh at gmail.com
Thu Mar 15 10:51:39 UTC 2018


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?

Regards,
Ashutosh Mehra


More information about the jdk-dev mailing list