I am running memcached in aws ec2 instance with total memory 61GB.
Memcached is started with the option -m 55000.
echo "stats" | nc localhost 11211 | grep "STAT bytes \|STAT limit_maxbytes"
STAT limit_maxbytes 57671680000
STAT bytes 27307766965
The RSS memory used by memcached process 57349091328.
Initially the bytes used for cache was little less than the limit_maxbytes. But it did not start evicting (as the limit is not reached).
I wrote a script to manually evict the expired keys and the bytes used came down to 27307766965 bytes. But the RSS memory of memcached process is still high. It did not come down.
Can someone help me understand the behaviour.