Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
A vLLM-style serving pod shows healthy GPU memory at startup. Over six to twelve hours, KV-cache utilization climbs monotonically, the scheduler admits fewer concurrent requests, latency rises, and eventually the pod OOMs. Request volume is steady throughout. Diagnose the pattern: what is leaking, what is the upstream trigger, and what three mitigations would you put in place?
Orphaned sequences from abandoned client streams pin KV cache pages forever. Fix with idle reaper, max session age, and end to end cancel propagation from gateway to inference server.
Imagine a coat-check at a busy restaurant. Each guest takes a numbered hanger when they arrive and returns it on the way out. If guests slip out a back door without claiming their coat, the hangers fill up. After enough nights, the rack has no free hangers and new guests get turned away even though the dining room is empty. The KV cache works the same way. Each chat request rents some pages of GPU memory to store its conversation state. The pages come back when the request ends cleanly. But if the user closes the browser tab, the inference engine never gets the end signal, the pages stay rented forever, and the rack slowly fills up. After hours of small leaks, there is no free space left and the pod crashes.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: identify orphaned sequences as the leaking entity, trace the disconnect from browser to inference server, walk through the three-layer mitigation (cancel propagation, idle reaper, max session age), and call out the slowloris variant only the hard cap catches.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Blaming the model or scheduler. The leak almost always lives in the gateway to inference cancel path, where client disconnects are silently dropped.
The night-before-the-interview bullets. Scan these on the way to the call.