memcached/memcached — pull request #93 by zwChan (2014-12-10 06:34:20+00:00)
Title: Release memory back to system

Add a feature that support release memory back to system. If the ratio of used items in a slab is less than release_mem_start(default is 50%), then start release memory; If the ratio of used items greater than release_mem_stop(default is 80%), then stop release memory.
It is not complicated because it base on the slab_reassign(auto move) function. The different is that the picked page is not assign to other slab, but freed. And it also depend on the lru_crawler to clear the expired items.
The feature is useful when a cache cluster support a lot of services(or application). We assign each service several cache instance in fixed size(say 4GB) randomly among cache servers(it's memory is 32GB or 64GB). Most of the time the service just used a few memory of their caches, and only reach the peak of memory usage at certain time. What is worse is that some services just don't know how much memory they need, so they required a lot of memory for 'safety'. With this feature, we can support more services using the current cache servers.