Cleaning expired items

Sean Chittenden sean at chittenden.org
Thu Dec 2 23:18:58 PST 2004


> Is there any way I can clean all the expired items, so I can claim back
> the memory they are using?

Not back to the operating system, no.  memcached grows, but never 
shrinks (at least not to my knowledge).

> Maybe this is CPU intensive work, but the CPU
> on memcached servers are mostly idle all the time. Is it possible to
> implement this into the server? So it will traverse all the items, and
> delete all expired items. Thanks in advance.

I think you're confusing expire/delete with memory deallocation.  In 
memcached, there is no memory deallocation: it only allocates in 1MB 
slabs.  In theory it'd be possible to deallocate if all of the bits in 
a slab were moved or deleted, but such a facility at present doesn't 
exist.  -sc

-- 
Sean Chittenden



More information about the memcached mailing list