HowTo: Flush o/s cache with win32 api call(s)?
Posted on 2006-06-21
Sorry if this if OT because it deals with the WinApi rather than MFC specifically.
I'm doing some tests to speed up file handling using vc6 and WinXp-Sp2 on a development computer that has 1 gig of memory and an AMD-64-3800.
I'd like to clear/flush the o/s cache before doing the timings so as to get valid "1st time through" elapsed times. Otherwise, the 2nd and subsequent tests are much faster and don't tell me much.
Is there a Win32 api call to accomplish this? Or series of calls?
Now I'm doing the equivalent of xcopy of a large directory to another directory ... this seems to work, but is tedious and time-consuming.