If you find that your process with memory-bound files is held on many of these pages, then this means that the OS did not need to drop any of your memory-mapped areas for transfer to other processes. So, how do you know that other processes actually need the memory currently used for mapped files? Just because the OS on physical RAM is small, doesnβt mean anything. Other processes require memory to force the OS to abandon the displayed pages and provide them with RAM.
So, it looks like your mmap-I / O process is starving for your other process, which uses RAM less often. One approach is to intelligently block memory during fasting. Take a look at VirtualLock for win32.
source share