Friday 5 July 2013

Clear disk cache in linux

When you execute 'htop' command in linux, sometimes you might have noticed a big yellow chunk in memory bar. That is the disk cache used by the sytem as a memory - usually for running services.

If this 'yellow' chunk gets bigger then the things really start to get worse. Here is a simple command to clear the cache.


sync; echo 3 > /proc/sys/vm/drop_caches 


If above does not work (in case of permissions denied), try to use the below line :


sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" 

No comments:

Post a Comment