I have a large binary file (about 1 GB) that I want to process sequentially. I’m using a memory mapped file to access the file. Is there a way to tell Windows to swap in the whole file as soon as possible? Currently, it looks as if windows is only loading a single page each time a page fault occurs which results in very slow processing.
Share
I’m really surprised nobody’s mentioned PrefetchVirtualMemory:
Here are some other links:
http://msdn.microsoft.com/en-us/library/ms810613.aspx
Performance of Win32 memory mapped files vs. CRT fopen/fread
http://duartes.org/gustavo/blog/post/page-cache-the-affair-between-memory-and-files
Personally, I have no idea whether any of this is a Good Idea or not for your application. But sure – try it, and see if it helps!
IMHO ..