← All questions
Inference & ServingMedium· vLLM· Memory Management· Scheduling

How does vLLM prevent out-of-memory errors at high load?

vLLM prevents OOM errors by implementing strict admission control based on PagedAttention block accounting. The scheduler tracks available memory in terms of blocks rather than raw bytes. Before admitting a request, it checks if the current free-block count, adjusted by a safety watermark, can accommodate the worst-case block requirement of the new request. If not, the request is rejected. Additionally, the system employs specific eviction policies, such as LRU over logical sequences and decisions between swapping or discarding blocks, to maintain stability.

Code playground (Python)