I see. Just to clarify what I understand from Trond's proposal:

- If given mem limit satisfies each slab class then preallocate
everything(all slabs, chunks...etc..).
- If given mem limit does not satisfy all slab classes then fallback
to system malloc.

Is this correct?

Thanks,

On Aug 25, 1:17 am, dormando <[email protected]> wrote:
> > I am currently fiddling with the slab allocator and one thing messes
> > my understanding of the concept. Think about the following scenario:
>
> > 1) start memcached with ./memcached -m 1 (with 1 Mb of memory limit)
> > 2) set mykey 0 0 11 --> allocates a 1 Mb slab and a chunk is returned
> > for about the smallest possible chunk
> > 3) set mykey2 0 0 200 -- ?
>
> > Now I cannot understand what happens in the 3rd step? There is no
> > memory left for another slab error returned or something else? I have
> > tried to test this on my machine but somehow cannot interpret the
> > results correctly. 2nd step does allocate 1 MB of slab with 96 bytes
> > of chunk size? I am right?
>
> http://code.google.com/p/memcached/issues/detail?id=95
>
> will be fixed at some point...

Reply via email to