DEV Community

Nerav Doshi
Nerav Doshi

Posted on

Found the Real Kubernetes Memory Ceiling — It Wasn't Double

Last entry left a real question hanging: the exact Podman number got killed under kind, twice. Did that mean the gap between the two runtimes was huge — needing something close to double the memory — or was the real ceiling only a little higher than 1663Mi, and I'd just clipped it? Only one way to find out.

Redeployed with the limit bumped to 2048Mi — a deliberately big jump, so the answer would be unambiguous either way:

kubectl delete pod ollama-sized
kubectl apply -f ollama-pod-2gb.yaml
kubectl exec -it ollama-2gb -- ollama pull llama3.2:1b
kubectl exec -it ollama-2gb -- ollama run llama3.2:1b
Enter fullscreen mode Exit fullscreen mode

Asked it a real question, checked the outcome:

kubectl top pod ollama-2gb
kubectl describe pod ollama-2gb | grep -A5 "Last State\|Restart Count"
Enter fullscreen mode Exit fullscreen mode

No crash. Restart Count: 0, and kubectl top showed real usage of 1775Mi — about 1.73GB. Which answers the question, and not the way I expected: that's only about 6.7% higher than Podman's 1.663GB. Not anywhere near double. The 2Gi limit worked, but it turns out to have been way more generous than actually necessary — the real ceiling sits much closer to 1663Mi than the size of my jump would suggest.

So that reframes last entry's open question. This wasn't a big structural gap between how Podman and Kubernetes handle memory. It was a narrow miss. Setting the limit at exactly a steady-state number, with zero margin for whatever memory spike happens during model loading before things settle down, was always going to be right on the edge of failing. Give it something like 10% headroom above the measured number, and it holds fine.

Which is really the actual lesson from this whole stretch of entries, more than "runtimes differ": a memory snapshot taken after a model is already loaded and idle isn't a safe number to use as a hard limit on its own. It doesn't account for the peak during loading. Going forward, my rule is measured steady-state number plus 10-15%, used as the real limit — not the raw number itself. 1663Mi measured should've meant something like 1875-1900Mi requested, and Entry 11's whole detour probably never happens.

Top comments (0)