Is there any way to make linux remove from memory all cached disk data? Our goal is to time some performance tests on various storage configurations and have each one start with a clean slate cache-wise.


How about this:

$ sync ; echo 3 > /proc/sys/vm/drop_caches
  • This same command is all I can find online, but I noticed it doesn't completely get rid of my cache. free and top still shows quite a bit of memory used up by some cache, and disk-intensive PostgreSQL queries are returning extremely fast run a second time, even though the cache has been supposedly cleared. – ehsanul Dec 21 '10 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy