TCMalloc don't release memory

Hi AlexisD,

This is an issue we are aware of, but with the current memory allocator (TCMalloc) there isn’t much more to be done - as you’ve seen release_free_memory asks TCMalloc to release what it can, but that isn’t always the bulk of the usage. As I mentioned in the previous thread you can swap-rebalance out the affected node(s) and then re-insert them - this will essentially restart the memcached process and hence reset the heap.

The good news is that we’ve made a number of changes in this area in the forthcoming 4.0 release - specifically moving to a different underlying memory allocator on Linux (jemalloc) and introducing a memory defragmentation task inside memcached to reduce the impact of fragmentation build-up.

I encourage you to try the 4.0-Beta on a test environment and see how that affects the memory usage with your workload.

1 Like