Tuesday, August 3, 2010

How to drop caches in Linux ?

Symptoms:
If the system is eating up lot of RAM eventually making the system slow then try freeing up the cache memory.

Before freeing up the cache, running sync flushes all the file system buffers.
In root, run the following commands:

To free pagecache, inodes and dentries:
root@inferno: echo 3 > /proc/sys/vm/drop_caches

To free only the pagecache,
root@inferno: echo 1 > /proc/sys/vm/drop_caches

To free only the dentries
root@inferno: echo 2 > /proc/sys/vm/drop_caches

No comments:

Post a Comment