I'm developing in C++ and C# and working with larger files (tens to hundreds of GB) and performance is a major issue. However, once a file has been read it is cached in memory and subsequent reads no longer go to disk. This makes it difficult to gauge the performance. For example, in the program I'm currently working on a run immediately after a reboot takes 92 seconds. Re-running the program (and until I change input files or reboot again) it only takes 7 seconds.
I've used RamMap and this helps but it doesn't appear to let me clear individual files and if I Empty everything then my timings are off because everything in the system has to be reloaded.
Is there any way C++ or C# function to tell Windows to clear cached files out of memory using a file naming mask?