jmtd → log → Introducing Red Hat UBI9 OpenJDK runtime images
A few weeks ago we shipped the first RHEL UBI9-based OpenJDK container images.
Universal Base Image (UBI) is an initiative where you can obtain, share and build upon official Red Hat container images without needing a Red Hat subscription. They're exactly the same base images that Red Hat products are built upon, composed entirely of Open Source software. Your precise rights are covered in the EULA.
Nowadays we offer two flavours of images, the original style (now termed builder images) and leaner runtime images, which have a subset of the JDK, and no build tools like Maven, etc.
We provide JDK11 and JDK17 for UBI9:
podman pull registry.access.redhat.com/ubi9/openjdk-11
podman pull registry.access.redhat.com/ubi9/openjdk-17
podman pull registry.access.redhat.com/ubi9/openjdk-11-runtime
podman pull registry.access.redhat.com/ubi9/openjdk-17-runtime
In comparison to the UBI8 images, we have done a lot of housecleaning. If you are curious as to exactly what we've changed, you can read the list of commits in this pull request.
Perhaps most notable is a change in the way we tune the JVM's memory. In our
existing images up to now, partially for legacy reasons, the container start
up scripts interrogate the cgroups (v1) virtual filesystems to establish any
memory limits imposed on the running container. From that, they calculated a
percentage of the memory limit as an absolute value, and then ask the JVM to
limit its heap to that calculated sum via the -Xmx
flag.
This dates back to a time when the JVM was not container aware. It now is, so
for the UBI9 images we instead ask the JVM directly for the percentage we
want using -XX:MaxRAMPercentage
. We've also changed the default percentage
from 50% to 80%, to better utilise the memory assigned to Java containers.
One big advantage of this is the JVM is cgroups (v2) aware, and the legacy start up scripts we wrote are not. But another is reducing the amount of code we run in the start up scripts, easing maintenance and simplifying the containers as much as possible.
Please give them a go, and let me (or us) know what you think!
Comments