---

How to Clear Memory Cache on Linux

By default, every Linux OS has an efficient memory management system used to clear the buffer cache periodically. You can manually free up the memory cache with the following simple command:

sk@sk:~$ sudo sh -c “sync; echo 3 > /proc/sys/vm/drop_caches”

However, if you want to force the Linux OS to do clearing memory cache on a particular interval, just add the command to cron job. Here, I show you how.

Get the Free Newsletter
Subscribe to Developer Insider for top news, trends & analysis
This email address is invalid.
Get the Free Newsletter
Subscribe to Developer Insider for top news, trends & analysis
This email address is invalid.