How To: Clear cache from your RAM
Posted: Sat Dec 17, 2011 4:50 pm
So, Gnome Shell being Gnome Shell, I notice it likes to eat up a lot of RAM with it's cache. Cache is a great thing until it doesn't make way for more useful things.
Whilst I should make you aware that it's not necessarily a bad thing (since when something NEEDS to use the ram, it should clear the old Cache out) It sometimes doesn't work that way.
An dead easily solution is to clear up some data from your ram is to use an old and trusted command I use to clear my servers RAM after an mysql dump.
And if you're like me and you leave your machine on for quite a number of days at a time, it might be best to add a cron job to take care of it daily. If you're not sure what cron is, take a quick read here http://tldp.org/LDP/lame/LAME/linux-adm ... -cron.html
And here is a little before and after as an example:
And after!
Hopefully this helps you guys out. If you have any questions, post them below!
Whilst I should make you aware that it's not necessarily a bad thing (since when something NEEDS to use the ram, it should clear the old Cache out) It sometimes doesn't work that way.
An dead easily solution is to clear up some data from your ram is to use an old and trusted command I use to clear my servers RAM after an mysql dump.
Code: Select all
sudo sync; echo 3 > /proc/sys/vm/drop_caches
And here is a little before and after as an example:
Code: Select all
total used free shared buffers cached
Mem: 7908 --->6288<--- 1619 0 206 4859
-/+ buffers/cache: 1222 6686
Swap: 8096 0 8096
Code: Select all
total used free shared buffers cached
Mem: 7908 --->1689<--- 6218 0 2 469
-/+ buffers/cache: 1218 6689
Swap: 8096 0 8096