Memory management

Jure Petrovic fonz at
Mon Mar 26 09:22:03 UTC 2007

Oh, just theoretical discussion for my thesis. I've read Bonwick paper
referenced in Brad's "Distributed caching with Memcached". It is said
that resizing slab classes could sometimes reduce internal

So, for example let's say we allocate 700 bytes for 64-byte slab class
and all of the objects stored have 40 bytes. This means we can store
17 objects and leave 20 bytes unused. (700bytes = 17objects * 40bytes +

In such cases (if I get that right) Bonwick suggests re-allocating that 
700 bytes in such manner, we wouldn't get that unused 20 bytes. That
means allocating either 680 or 720 bytes (17 or 18 objects).

Please check attached schematics in pdf to see if I got that right. And
you say that allocation in memcached is fixed for each particular

On Sun, 2007-03-25 at 11:30 -0700, Steven Grimm wrote:
> Slab sizes -- or rather, the sizes of the items in each particular class 
> of slabs -- are fixed at startup. Can you give an example of the kind of 
> fragmentation you're seeing (or expecting to see)?
> -Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fig25-mc_internal_frag.pdf
Type: application/pdf
Size: 27232 bytes
Desc: not available
Url :

More information about the memcached mailing list