Memory Management

Redis is an in-memory database. How it handles RAM is the difference between peak performance and a system crash. Explore allocation, overhead, and eviction.

Live Allocation Map
Visualize memory blocks and manual eviction
Memory Usage (0 / 100MB)0.0%
Memory is empty...

LRU (Least Recently Used)

Favors retaining keys that were accessed recently. Good for general caching where old data is less likely to be needed.

LFU (Least Frequently Used)

Favors keys with high access counts. Better for scenarios where popularity remains stable over time.

Allocation Strategy

Redis doesn't allocate memory directly from the OS for every key. It uses a general-purpose allocator like jemalloc or libc malloc.

Jemalloc is the default on Linux because it reduces memory fragmentation, which is the biggest enemy of long-running Redis instances.

Fragmentation Ratio

The ratio between memory requested from the OS and memory actually used by Redis. A ratio > 1.5 usually indicates serious fragmentation.

maxmemory-policy
PolicyBehavior
noevictionReturns errors when memory is full.
allkeys-lruEvicts least recently used keys.
volatile-lruOnly evicts keys with an expire set.
allkeys-randomEvicts random keys to make room.
Memory Overhead of a Redis Object
16B
Redis Object Header
8B-24B
Pointer / metadata
??B
Actual Payload
8B
Allocator Overhead

Even a tiny 1-byte string can take up to 40+ bytes in RAM due to the object header and allocator alignment.

© 2026 Redis Visualizer. Built for educational purposes.