> Hi,
>
> Saw something interesting today, hoping someone can confirm. If I run 
> memcached with these settings:
>
> memcached -vv -m 1m -I 1m -p 9999 -t 12 -U 0 -D _ -f 1.05
>
> There are 182 slab classes. I've set the max memory to 1 meg and my page size 
> to 1 meg. So in theory memcached should only allocate 1 page. The puzzling 
> thing is, if I add an object of appropriate size to each of the slab class, 
> 182 total pages get allocated. meaning
> that memcached ends up using ~182 meg of memory. This seemed really odd since 
> the "max memory" is set at 1meg.
>
> Now, if I add a billion objects of the SAME size (thus to the same slab 
> class) my memory remains constant at about 2 megs. This makes sense, since 
> only 1 page will be allocated to that slab, and no matter how many objects I 
> put in, other objects will get evicted.
>
> My conclusion then is, memcached will always assign 1 page to a slab class 
> and will not do any memory checks on whether this exceeds the -m memory 
> setting. Anybody confirm?
> Much thanks!

Yes that's correct... it was added a long time ago to prevent people from
getting OOM errors occasionally on long running instances (where certain
slabs are used more rarely).

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to