Will memcached cause memory leak?

Steven Grimm sgrimm at facebook.com
Mon Aug 13 10:20:51 UTC 2007


A reference count is not the same thing as the number of times an item 
has been accessed. The two have nothing to do with each other. 
"Reference count" is a computer science term:

http://en.wikipedia.org/wiki/Reference_count

Look at the source code again and pay specific attention to when the 
reference count gets incremented and decremented, and perhaps the 
purpose will become clearer.

-Steve


John.H wrote:
> I have read the source code of memcached,and I found it only free the 
> item whose refcount is 0
> But if I have visited every item in the memcahced,so no item's 
> refcount is 0,so no item will be removed even the LRU is turn on?
> So when will the item be removed?



More information about the memcached mailing list