redis
memory_error
ai_generated
true
OOM command not allowed when used memory > 'maxmemory'
ID: redis/oom-maxmemory
85%Fix Rate
90%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 7 | active | — | — | — |
Root Cause
Redis memory limit reached and eviction policy does not allow the operation.
genericWorkarounds
-
90% success Set appropriate eviction policy
CONFIG SET maxmemory-policy allkeys-lru # evict least-recently-used keys
Sources: https://redis.io/docs/
-
85% success Increase maxmemory if the server has available RAM
CONFIG SET maxmemory 4gb
-
88% success Analyze memory usage to find large keys
redis-cli --bigkeys # finds largest keys per type; redis-cli MEMORY USAGE key_name
Dead Ends
Common approaches that don't work:
-
Remove maxmemory limit entirely
85% fail
Without limits, Redis grows until the OS OOM killer terminates it, losing all data
-
Flush all data (FLUSHALL) to free memory
72% fail
Destroys all data. Only appropriate if data is a rebuildable cache.