Niklas blog

Just another WordPress weblog

Flushing the Linux file cache

September 11th, 2009 in linux

When performance testing IO-bound code it is often desirable to make sure that the file cache in Linux is empty. Here’s how to:

root@foo:~# sync
root@foo:~# echo 3 > /proc/sys/vm/drop_caches

This works since kernel 2.6.16. More info: http://www.linuxinsight.com/proc_sys_vm_drop_caches.html

Tags: ,

Comments are closed.