Clearing Memory (RAM) Cache on CentOS
10,816
You don't need to do this. Linux will drop all caches if it needs the RAM for other purposes. See http://www.linuxatemyram.com/ and Why is Linux reporting "free" memory strangely? for more information.
Related videos on Youtube
Author by
user3650841
Updated on September 18, 2022Comments
-
user3650841 over 1 year
I know this has been asked in a similar way in the past but I'm just curious.
If I made a script and made it run every midnight to check if my memory usage was higher than let's say, 80... would it be a bad idea to make the script automatically run
sync; echo 1 > /proc/sys/vm/drop_caches
? I often get into an issue where my RAM usage gets to 99% because of this and I'm just getting a little bit worried.Thanks in advance.
-
Admin over 9 yearspossible duplicate of Why drop caches in Linux?
-
Sreeraj over 9 yearsHow do you check the memory usage and free memory?
-
user3650841 over 9 years
$ free | grep Mem | awk '{print $3/$2 * 100.0}'
-
David Schwartz over 9 yearsAre you seriously asking how to get your computer to waste more memory rather than using it efficiently?
-