Debugging llama.cpp: sliding-window context checkpoints silently eat your RAM

jomi-se · reddit · 2026-10-31

The author hit a crash running Gemma 4 12B in llama.cpp and traced it to an OOM in RAM, not VRAM. The culprit was context checkpoints piling up during stress testing: checkpoints are snapshots of Sliding Window values at strategic positions, letting you resume from a spot already outside the window without recomputing all token KV values.

The default keeps 32 checkpoints per slot at 320MiB each—too much for 16GB of RAM—while simple chat continuation rarely needs more than 4. He also had Opus generate an animated explainer and wrote a blog post about it.

Original post →

More from Infra

Infra channel →