Redis: OOM command not allowed when used memory > 'maxmemory'
Redis reached its maxmemory limit and the eviction policy (noeviction) refuses new writes.
Seen on:
Redis
Meaning
With maxmemory-policy noeviction (default), writes fail when memory is full. Caches should use an LRU/LFU policy; data stores need more memory or less data (TTL on keys).
Common causes
- maxmemory reached with noeviction policy
- Keys without TTL growing forever
- Large values/collections
- Memory fragmentation
⚡ Quick fix
- Set an eviction policy for caches (allkeys-lru)
- Add TTLs to cache keys
- Increase maxmemory / instance size
Detailed fix by platform
Shell
- bash
redis-cli INFO memory | grep -E 'used_memory_human|maxmemory_human|maxmemory_policy' redis-cli CONFIG SET maxmemory-policy allkeys-lru redis-cli --bigkeys
How to diagnose
- Memory — used vs maxmemory
- Policy — maxmemory-policy
- Keys — Big keys / no TTL
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026