Linux Lite Forums
Free memory - Printable Version

+- Linux Lite Forums (https://www.freecinema2022.gq/forums)
+-- Forum: General (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=4)
+--- Forum: On Topic (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=14)
+--- Thread: Free memory (/showthread.php?tid=3099)



Free memory - LinuxNoob - 07-01-2016

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/free-up-and-release-unused-or-cached-memory.shtml#comments

Basically a quite convenient way to go about it.

Thank you.


Re: Free memory - JmaCWQ - 07-01-2016

I use these occasionally.
free -m to see how much is being used
sudo sysctl -w vm.drop_caches=3 to clear it.


Re: Free memory - Valtam - 07-02-2016

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'"



Re: Free memory - LinuxNoob - 07-02-2016

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