News about our company, tutorials about IT and much more you will find in this page.
Many times Linux systems face low memory issues when they’re running for a while. The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn’t used. Cache is used to keep data frequently used by the operating system easily accessible. Reading data from cache is 1000’s times faster than reading data from the hard drive.
It’s good for the OS to get data from cache on memory. But if any data is not found in the cache, it reads from the hard disk. So it’s not a problem to flush cache memory. This article has details about how to Flush Memory Cache on a Linux Server.
Use slabtop display kernel slab cache information:
You can also see with “vmstat -m”:
And look /proc/slabinfo:
Free pagecache, dentries and inodes in cache memory
Free dentries and inodes use following command
Free only the pagecache using the following command
Schedule Cron to Flush Cache Regularly
It’s a good idea to schedule the following in crontab to automatically flush cache on regular interval.
0 * * * * sync; echo 3 > /proc/sys/vm/drop_caches