I’ve just installed a brand new server image, and have been finding that MySQL has been consuming a lot of memory despite the fact that nobody’s been querying it. I checked
free -m
to see if it was a matter of cache (à la http://www.linuxatemyram.com/), but it wouldn’t appear to be. I’ve tried restarting the service, and the same amount of memory is used. I am running Ubuntu 12.04. Is this a memory leak? How can I fix this?
# free -m
# htop
# ps aux
Answer
First: If after a restart of a service, the same amount of memory is used, a memory leak can be ruled out because this results in “loss” of memory over time due to programming bugs where memory isn’t freed correctly.
Second: What is your problem? You have a tiny server with 256 MB of RAM, 182 MB of which is still usable. Should you be worried about the “VIRT” number: This has nothing to do with the real amount of memory used, it’s a number that includes a lof of stuff, much of which has nothing to do with real memory. Please read man top
to learn what the numbers mean before starting to worry.
Attribution
Source : Link , Question Author : Joseph Szymborski , Answer Author : Sven