Details
-
Improvement
-
Resolution: Fixed
-
Major
-
2.5.1, 3.0
-
Security Level: Public
-
None
Description
On many occasions we have seen tcmalloc being very "greedy" with free memory and not releasing it back to the OS very quickly. There have even been occasions where this has triggered the Linux OOM-killer due to the memcached process's having too much "free" tcmalloc memory still resident.
tcmalloc by design will /slowly/ return memory back to the OS - via madvise(DONT_NEED) - but this rate is very conservative, and it can only be changed currently by modifying an environment variable, which obviously cannot be done on a running process.
To help mitigate these problems in future, it would be very helpful to allow the user to request that free memory is released back to the OS.