As far as I can tell, the cgroups setting isn’t being made available to the JVM correctly. See this build.This results in the JVM being killed with 137 error rather than OutOfMemoryError (in some other private builds).
The build shows a docker image -
circleci/openjdk:11.0.2-jdk - being used that then calls on to Maven. Maven is started using
MAVEN_OPTS: -XX:+PrintFlagsFinal to show what Java is seeing. As shown, the
MaxRAM setting is 137Gb, not 4Gb showing that Java can’t see the memory from cgroups. But
cat on the cgroups file shows an even larger number.
I don’t think I’m doing anything wrong based on my reading of multiple blog posts that indicate Java should just pickup the memory limit now (and the logging shows that
MaxRAM is not
ergonomic). I’m not sure where the problem is, and whether the
cat value is significant of not.
As it stands, I have to use
MAVEN_OPTS=-XX:MaxRAM=4g to ensure that the JVM is correctly informed of the enforced memory limit.
Am I missing something obvious?