Possible Duplicate:
How to invalidate the file system cache?
In order to be able to so some benchmarks I need to cleanup Windows disk read cache. How can I do this?
In fact I want to compare if loading a big Unicode file (UTF-8 or UTF-16) from disk is faster or not, considering that in memory I do keep UTF-16.
I know that it should be no significant difference but in order to benchmark it I need to be sure that that file is not cached - I need to see if size on disk has more or less impact than decoding the file.
Someone from Microsoft helped me out with this a few years ago (back in the days of Windows XP) and gave me a solution that met my needs at the time. I already had two drives in my machine, and what I needed to test was already on the D drive, and fortunately I didn't need to keep any files open on my D drive when I wanted to flush the cache. From the Windows Disk Management interface, I could change my D: drive letter to another letter, and then back again, and the D drive would perform as if had a cold cache in the OS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With