Kubernetes 1.35 in-place memory resize may not need a restart on ZGC and Shenandoah
A common recommendation is to set resizePolicy to RestartContainer for memory on every JVM container in Kubernetes 1.35. The author argues this is right for raising the heap ceiling, which is fixed by -Xmx at startup, but not for shrinking and regrowing within a ceiling chosen at launch. In their Linux container tests on ZGC and Shenandoah, a container's limit dropped from 900 MB or 700 MB to 300 MB without a restart, provided the JVM released memory first. Lowering the limit before the JVM released memory caused OOM kills every time. The author notes that the ZGC and Shenandoah SoftMaxHeapSize flag, which can be changed at runtime, makes this approach possible. The tests were run on Eclipse Temurin 21 with Docker Desktop using cgroup v2, which is a simulation rather than a full kubelet-driven pod resize.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in