Page 1 of 1

Flush Memory

Posted: Sat Oct 12, 2019 9:36 am
by jeanmarc
Hi,
Some are worried about seing the RAM usage growing in Linux. Though it's plain normal, the RAM is not wasted but cached. It's faster to get data from memory than disk and if your system need memory it will do the clean-up.
You may see usage with free -m.

Even thougt you wish to wipe, you can make a daily clearcache.sh script to flush :

Code: Select all

#!/bin/bash
#Free pagecache, dentries and inodes in cache memory
echo "echo 3 > /proc/sys/vm/drop_caches"
If you have a swap, you can also add swapoff -a && swapon -a.
Then, chmod +x clearcache.sh and call it a cron job or via systemd.
And please, don't ever reboot daily ;)