How to purge disk I/O caches on Linux?

taw picture taw · Mar 4, 2012 · Viewed 61.1k times · Source

I need to do it for more predictable benchmarking.

Answer

Chris Dennett picture Chris Dennett · Mar 4, 2012

Sounds like you want the sync command, or the sync() function.

If you want disk cache flushing: echo 3 | sudo tee /proc/sys/vm/drop_caches