[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Container awareness and cgroup limit discreprancy between OpenJDK JRE 10 and JRE 11 and between OpenShift Origin 3.11 and OpenShift Online 3.11



Hi,

On OpenShift OKD 3.10 (docker-1.13.1-74.git6e3bb8e) and 3.11 (docker-1.13.1-75.git8633870) the following command:

docker run -m 256m openjdk:10-jre java -XX:+PrintFlagsFinal -version | grep MaxHeapSize

returns 1/4 of the total memory of the underlying host instead of the 130ish mbs it should return. Cgroup memory limits are not respected.

docker run -m 256m openjdk:11-jre java -XX:+PrintFlagsFinal -version | grep MaxHeapSize

On the same OpenShift versions the command returns the expected amount, i.e. JRE 11 behaves as expected on both 3.10 and 3.11 and cgroup memory limits are respected.

Running a pod using the following simple Java 10 image https://hub.docker.com/r/thorsager/jvm-mem-test/ the problem is the same for both versions.

Running the same JRE 10 memtest image on Openshift Online, container awareness in JRE 10 works as expected and cgroup limits are respected.

Running:

docker run -m 256m openjdk:10-jre java -XX:+PrintFlagsFinal -version | grep MaxHeapSize

on docker-ce 18.06 JRE is container aware and returns the expected result.

The problem seems to be correlated with how /proc/self/mountinfo is layed out and seen inside the container by Java.

My questions are:

1. What tweaks, if any, has Red Hat done on OpenShift Online to get Java 10 to respect cgroups? 2. How exactly does Java 10 determine if it is running inside a container on OpenShift?

Best regards,
Rasmus Edgar


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]