Scalability and Performance · Remembering answers
Cache eviction policies
When a cache is full, every new entry pushes an old one out. The eviction policy decides which one, and a good choice keeps the hit ratio high with less memory than you would guess.
- Time20 min
- LevelDeveloper
- Experiments1 live
- Check6 questions






App sends SET for a new key.
Memory check used memory is above maxmemory, so Redis must free some first.
Store once memory is back under the limit, the new key is written.
Dataset (maxmemory) keys and values; eviction keeps this under the limit.
Replication and AOF buffers not counted toward maxmemory; leave room for them.
Copy-on-write during snapshots pages changed while a child process saves get duplicated.
Operating system and other processes squeeze them and Redis gets swapped to disk.