Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Add Garbage Collector #25

Open
qbolec opened this issue Mar 29, 2013 · 3 comments
Open

Add Garbage Collector #25

qbolec opened this issue Mar 29, 2013 · 3 comments

Comments

@qbolec
Copy link

qbolec commented Mar 29, 2013

I see that you've invested a lot of time in stackable Eviction Strategies.
That's good for me, because that means, that you've already made the first step : admitted that the default LRU is not as good as it could.

Perhaps you would like to incorporate this changeset:
https://groups.google.com/forum/?fromgroups#!topic/memcached/MdNPv0oxhO8
which makes sure that expired items are never in memory, and does so in O(1).
We use it in nk.pl since years at it works great (evictions dropped to 0, and monitoring memory consumption provides more information now -- also, slabs now have a chance to become emptied and disposed).

The only drawback I can see with it is the additional O(1) memory per item for doubly linked list pointers. I believe that Twitter hires some tough hackers which could make this number smaller (how about the trick with XORed pointers?).

@thinkingfish
Copy link
Contributor

We have given garbage collection some serious thoughts and I agree with you on the benefits it could bring. What stopped us from simply incorporate something similar already was the memory overhead, which is noticeable for smaller items.

I feel quite a few things could be done to make memory management better, unfortunately I have to shelf the development on Twemcache (other than bug fixes) due to lack of resources. Hopefully I can come back to this in the summer (Q3) and do an in-depth summary and planning about the memory management module as a whole.

@qbolec
Copy link
Author

qbolec commented Apr 7, 2013

Cool, please let me know if I could help somehow in the process.

@thinkingfish
Copy link
Contributor

I think the better approach, as Jamie suggested in the thread, is to use a background, latency oblivious thread to do the clean-ups. If you want to extend the current threading architecture of Twemcache, which uses background threads for various tasks, I'll be happy to review it and merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants