-1

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.

user3650841
  • 21
  • 1
  • 2
  • 7

1 Answers1

5

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.

Sven
  • 97,248
  • 13
  • 177
  • 225