Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

How about this:

$ sync ; echo 3 > /proc/sys/vm/drop_caches
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.