Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to flush the disk read cache under Windows? [duplicate]

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.

like image 271
sorin Avatar asked Aug 26 '10 10:08

sorin


1 Answers

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.

like image 87
Jeff Grills Avatar answered Sep 29 '22 15:09

Jeff Grills