Last Updated on
Let’s go through the process to clear memory cache and buffer on Linux based operating systems. We will show how to flush memory cache on Linux.
How to clear the Memory Cache using sysctl You can also Trigger cache-dropping by using sysctl -w vm.dropcaches= number command. To free pagecache, dentries and inodes, use the below command. Linux memory cache clear. Shell by juliocorradi on Jul 01 2020 Donate. # clear pagecache only. Sync; echo 1 /proc/sys/vm/dropcaches # clear dentries and inodes. Sync; echo 2 /proc/sys/vm/dropcaches # clear pagecache, dentries and inodes. Sync; echo 3 /proc/sys/vm/dropcaches.
How To Clear Memory Cache And Buffer On Linux
We have different option to clear memory on Linux.
First option to clear memory caches on Linux.
Command to free pagecache, dentries and inodes in cache memory in Linux.
Second option to clear memory cache.
Command to free dentries and inodes
Third option to clear memory cache on Linux.
Run the following command to free pagecache only:
How To Schedule Cron To Flush Cache Regularly
Run the following command to schedule cron to flush cache regularly. It makes your job easier and reduce the work pressure. Use ‘crontab -e’
command to edit cron on your Linux.