Issue
When running CloudBees CI in a container with Linux kernel 6.12.0 and newer, the container may get OOMKilled.
This issue is related to a change in Linux Kernel 6.12 and newer versions related to cgroups, tracked by https://bugs.openjdk.org/browse/JDK-8349988 and https://bugs.openjdk.org/browse/JDK-8347811.
As a result of this change, instead of the container getting 1/4 of the container memory limit by default, it gets 1/4 of the host memory limit.
Using the recommended -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0
as JVM options will still result in the container getting 50% of the host memory limit (instead of the container memory limit), which is likely to cause the container to get OOMKilled.
Resolution
Wait until CloudBees CI is running on Supported JDK version that has the fix for https://bugs.openjdk.org/browse/JDK-8349988, which is currently only available in JDK 25, or wait for that fix to be backported to JDK 21.
Workaround
If running CloudBees CI in a container with Linux kernel 6.12.0 or newer without a corrected JDK version, you can add -XX:MaxRAM
with your current container memory limit to the Java Options
for controllers and to OperationsCenter.JavaOpts
helm values for CloudBees CI on modern cloud platforms operations center to ensure that the container gets the chosen memory limit instead of the host memory limit:
-XX:MaxRAM=Xg -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0 # For example, if the container memory limit is 4g, the JVM heap will get 2g if you use: # -XX:MaxRAM=4g -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0 # For example, if the container memory limit is 3072m, the JVM heap will get 1536m if you use: # -XX:MaxRAM=3072m -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0