Reputation: 11415
I have memory-mapped a file and I get data from it using MemCpy. Sometimes it is lightening fast, and sometimes surprisingly slow. For example: Once 0.15 milliseconds, then the same operation 6 seconds.
I am not sure where the bottleneck is or how to resolve it.
I think I will therefore need to do some rather "deep" analysis to find out what exactely makes the MemCpy operation so slow sometimes.
Can somebody suggest what I should do to track the problem?
Upvotes: 2
Views: 175
Reputation: 393944
I think you may want to use
Locks the specified region of the process's virtual address space into physical memory, ensuring that subsequent access to the region will not incur a page fault.
There's a background page Working with Pages that lists and describes more relevant API calls.
Upvotes: 2