We did not make a single code-level change to achieve this reduction. The main driver was the JVM change itself.
Java 21 includes a number of runtime and garbage collection improvements that can positively affect memory behavior, especially in long-running server applications like Jenkins. While the exact impact depends on workload and configuration, the following areas are commonly relevant:
-
improved garbage collection behavior
-
runtime optimizations in the JVM
In our case, the upgrade improved the memory usage in our production environment significantly.
This is a companion discussion topic for the original entry at https://www.jenkins.io/blog/2026/05/08/JVM-upgrade/