Blog Links: #Java SE support for #Docker CPU and memory limits

By | May 18, 2017

A very important release announced in a post on the Oracle blog. Java SE support for Docker CPU and memory limits

In short: “As of Java SE 8u131, and in JDK 9, the JVM is Docker-aware with respect to Docker CPU limits transparently.”

SET 1:
If -XX:ParalllelGCThreads, or -XX:CICompilerCount are not specified as command line options, the JVM will apply the Docker CPU limit as the number of CPUs the JVM sees on the system. The JVM running inside the docker container will see the container (with its limits) as a bare-bone machine

SET 2:
If no -Xmx, or -Xms are not specified as command line options, there are two JVM command line options required, -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

So now setting up CPU and memory limits to a docker container in which a JVM is running makes more sense.

So now a version 3 docker-compose file of a jboss image having Java SE 8u131 from the original:

can be written with the new features in a shorter version and more clear: