OpenClaw

OpenClaw out-of-memory (OOM)

An OOM kill happens when the OpenClaw process exceeds available RAM or VRAM, so the OS terminates it before it can respond, often with no error in the chat. Switch to a smaller or more quantized model, cap contextTokens on the model entry (e.g. 32000), and free memory, add swap, or use a host with more RAM.

Likely cause

The model is too large for the available RAM or VRAM, so the OS kills the process before it can respond.

The fix

  1. 1 Switch to a smaller or more heavily quantized model.
  2. 2 Cap the context per request with contextTokens on the model entry in ~/.openclaw/openclaw.json (e.g. 32000). For local models, also lower the context length on the model server itself (Ollama num_ctx). OpenClaw has no maxContextTokens or maxIterations setting.
  3. 3 Free RAM / VRAM or add swap, or run on a host with more memory.
ollama pull qwen2.5:7b-instruct-q4_K_M
Full guideOpenClaw OOM Errors: Diagnosis and Prevention

Hit a different error?

Paste any agent error and get the cause and fix in seconds.

Open the decoder

Frequently asked questions

There's no error message, the agent just died. How do I confirm it was OOM?

Check the system journal for 'Out of memory' or 'oom-kill' entries (dmesg | grep -i oom). In Docker, check the container status for 'OOMKilled: true'. The process is killed before it can log anything itself.

It ran fine for days, then crashed. Why now?

That pattern means your baseline memory sits close to the limit and a burst of activity pushed it over. A long session with a big context or a large local model is the most common cause. Cap contextTokens on the model entry, start fresh sessions with /new, and prune unused skills to lower the baseline.

How much RAM do I actually need?

A 1GB VPS can't run OpenClaw reliably and a 2GB box only works with careful config. For a production agent with a few skills, use 4GB+. If you also run a local model on the same host, it competes for the same memory.

Stop firefighting agent errors

Decoding errors one at a time is the manual version of what BetterClaw automates. Run your agents on a no-code AI agent platform with managed models, retries and config validation built in.

Free plan available · Pro $49/mo · BYOK · 7-day money-back guarantee