Free up memory/cache on Linux system using /proc/sys/vm/drop_caches

To speed up operations and reduce disk I/O, the kernel usually does as much caching as it has memory.

This sometime could led to extremely low free space, for new operation and we need to clear those cache in order to free up memory .

Writing to /proc/sys/vm/drop_caches allows one to request the kernel immediately drop as much clean cached data as possible.

1. To clear PageCache only run:

[root@dmcluadm03 ~]# sync; echo 1 > /proc/sys/vm/drop_caches

  2. In order to clear dentries (Also called as Directory Cache) and inodes run: 
 [root@dmcluadm03 ~]# sync; echo 2 > /proc/sys/vm/drop_caches

 3. In order to clear PageCache, dentries and inodes run:  
 [root@dmcluadm03 ~]# sync; echo 3 > /proc/sys/vm/drop_caches

 

 932 total views,  1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *