← All guides

Fix OpenClaw / Ollama Out of Memory: "killed", OOM, Model Won't Load

A deep-dive on out-of-memory errors running local models in OpenClaw: process killed, CUDA OOM, or the model refusing to load. Part of the OpenClaw troubleshooting hub.

Stuck on this? Get 1:1 OpenClaw help

Remote rescue for model loading, memory, quantization, and hardware-fit problems. See the rescue session →

If your local model gets killed, throws CUDA out of memory, or simply refuses to load, the model plus its KV cache didn’t fit in memory. The fast fixes are: drop to a smaller quantization, shrink the context window, and close other apps. If the model still won’t fit, the machine genuinely doesn’t have enough memory for that model, and this page shows the upgrade ladder.

Error: llama runner process has terminated: signal: killed
CUDA error: out of memory

Why this happens

Running a model locally has to hold two things in memory at once:

  1. The weights — roughly 0.6 GB per billion parameters at Q4_K_M. A 27B model is ~16-18 GB; a 70B is ~40 GB.
  2. The KV cache — grows with your context window. A large context (32K+) can add several GB on top of the weights.

When weights + KV cache exceed your available RAM (CPU/unified memory) or VRAM (discrete GPU), the OS kills the process or CUDA reports out of memory. The why-is-my-local-llm-so-slow guide covers the sibling problem where a model fits but crawls; this page is about when it doesn’t fit at all.

Fixes that don’t cost anything

1. Drop the quantization

Q4_K_M is the sweet spot for coding models: much smaller than Q5/Q8, with minimal quality loss. If you’re on Q5, Q6, or Q8, switch to Q4_K_M and you’ll often reclaim several GB.

# Pull the Q4_K_M variant instead of a larger quant
ollama pull qwen3:27b-q4_K_M

2. Shrink the context window

The KV cache is the hidden memory hog. If the weights fit but you OOM partway through a long conversation, your context is the culprit. Drop it to something that fits in the memory you have left after weights (e.g. 8K-16K).

# Lower the context OpenClaw requests from the local model
openclaw config set agents.defaults.context 16384

3. Free memory before loading

  • Close browsers, IDEs, and other heavy apps, they eat the RAM the model needs.
  • On a discrete GPU, make sure nothing else is using VRAM (nvidia-smi shows what’s resident).
  • Use /new in OpenClaw to reset a bloated session instead of letting context grow unbounded.

4. Pick a model that fits your tier

If a 70B keeps OOM-ing on a 24 GB machine, it’s the wrong model for the hardware. Use the best local LLM by RAM and best local LLM by GPU guides to pick a model that fits, a well-chosen 27B-32B at Q4 beats a 70B you can’t load.

When the model genuinely needs more memory

Sometimes the model you want is simply bigger than the machine you have. If you’ve dropped to Q4, cut context, and freed memory and it still won’t fit, that’s a hardware-fit problem, not a config bug. Here’s the upgrade ladder for local OpenClaw work, matched to what each tier can actually load.

🖥️ THE UPGRADE LADDER — RIGS THAT ACTUALLY FIT THE MODEL

Pick the tier that fits the model you keep OOM-ing on. 24 GB (RTX 3090 or a 24 GB Mac) runs 27B-class models at Q4; 48 GB+ Macs handle bigger models; a 96 GB workstation card runs 70B-plus at long context.

Rough fit guide: 24 GB loads 27B-class models at Q4 with room for moderate context. 48 GB opens up larger models and longer context. 96 GB (the RTX PRO 6000 Blackwell) is workstation territory for 70B-plus at long context without quantizing to death. Match the tier to the model you actually keep failing to load, not the biggest number.

Quick reference

Symptom Cause First fix
signal: killed on loadWeights exceed RAM/VRAMDrop to Q4_K_M
CUDA out of memoryModel + KV cache > VRAMLower context window
OOM only in long chatsKV cache grew with context/new + shrink context
Won't fit after all fixesModel bigger than machineStep up a hardware tier

Need help?

If you’re not sure whether to re-quantize, cut context, or upgrade, we offer a fixed-scope remote rescue session that includes a hardware-fit review. See OpenClaw troubleshooting help →

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

Read next

OpenClaw Returns Blank or Empty Responses? Here's the Fix
OpenClaw replies with an empty bubble or no reply at all? The 5-step diagnostic and the 4 real causes: model unreachable, channel down, context too large, model starved for RAM.
OpenClaw Keeps Using Claude Instead of Your Local Ollama Model — Fix
OpenClaw keeps calling Claude/Anthropic even though you set up Ollama? Fix the default chat model, kill env overrides, and verify with openclaw models status.
Can I Run a Local LLM With 64GB RAM and 24GB VRAM?
Direct answer for 64GB system RAM plus a 24GB GPU such as RTX 3090 or RTX 4090: what runs well, where 64GB gets tight, and which OpenClaw calculator preset to use.
Best LLM for 64GB VRAM (July 2026): Dual RTX 5090 Picks, Not Mac RAM
Best local LLM for 64GB VRAM, July 2026: Laguna S 2.1 UD-IQ4_XS (57.6GB), Laguna XS 2.1, gpt-oss 120B Q4. Dual RTX 5090 vs 2x A6000 vs 96GB Blackwell.