Linux Lite Forums

Full Version: Free memory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone! I been Googling for an easy way to free up memory with a few terminal commands instead of using a program like Bleachbit. I searched the forum before posting here.

Found this but I keep getting permission denied!
http://blog.midnightmonk.com/225/linux/f...l#comments

Basically a quite convenient way to go about it.

Thank you.
I use these occasionally.
free -m to see how much is being used
sudo sysctl -w vm.drop_caches=3 to clear it.
I use this on my servers, add it to your .bashrc

Code:
alias flushmem="sudo sh -c 'echo 1 >/proc/sys/vm/drop_caches' && sudo sh -c 'echo 2 >/proc/sys/vm/drop_caches' && sudo sh -c 'echo 3 >/proc/sys/vm/drop_caches'"
Thank you! and I'm sorry I could not reply sooner. Had some things come up that kept me away from the computer.

I'll make a batch file to run those