There are several major differences between the way jemalloc handles its miniature pools compared to how Memcached handles its slabs, the biggest of which being that Memcached never releases memory back to the OS. Of course that's because Memcached pre-allocates all memory in advance, and assumes that all memory will be wanted for the duration of of the process. On the other hand, jemalloc was designed as a generic memory allocator that happens to be well-behaved when it comes to dealing with memory fragmentation over time, assuming reasonable allocation behavior.
Knowing what I do about jemalloc and Memcached's memory allocator, I don't believe that there is any advantage to using any part of the Memcached slab allocator in Redis at all, and I know there are several drawbacks. The primary drawback being that most Redis users wan't Redis' memory usage to be a function of actually used memory, but the Memcached slab allocator doesn't actually return memory to the OS, so prevents this kind of (desired) behavior. This is literally a deal killer for many Redis users.
Don't get me wrong, I proposed using parts of what Memcached was using on an individual slab basis, as Python uses a similar method of pre-allocated arenas for some of its smaller objects to great success (and that's where I'm coming from). But in practice, that additional overhead of design and implementation outside of the allocator, which already does 99% of the same stuff already, is quite literally a waste of time. The jemalloc allocator is pretty awesome, and you don't need to trust me: read about it. And if after reading you think that any part of the Memcached system offers any advantages to Redis, state your reasons with references to externally verifiable information. Until then, please read up on jemalloc :)
- Josiah