Drop Caches

0 views
Skip to first unread message

naresh

unread,
Jul 9, 2007, 9:46:10 AM7/9/07
to Delhi/NCR Linux Users Group
Kernels 2.6.16 and newer provide a mechanism to have the kernel drop
the page cache which can help free up a lot of memory.

To use /proc/sys/vm/drop_caches, just echo a number to it.

To free pagecache:

# echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

# echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation and dirty objects are not
freeable, the user should run "sync" first!

Thanks
Naresh

Reply all
Reply to author
Forward
0 new messages