Flush Memory

A category for tips and tricks or off-topic things
Posts: 2144
Joined: Thu Aug 29, 2013 7:16 am

Flush Memory

Post by jeanmarc » Sat Oct 12, 2019 9:36 am

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

#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 ;)


Who is online

Users browsing this forum: No registered users and 1 guest