1

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.

Skyhawk
  • 14,149
  • 3
  • 52
  • 95

1 Answers1

3

How about this:

$ sync ; echo 3 > /proc/sys/vm/drop_caches
EEAA
  • 108,414
  • 18
  • 172
  • 242
  • 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