Question

Is it possible to create a memory mapped file for interprocess communication with a guarantee that the content is always being kept in RAM and not flushed to page file?

I am currently working on a bespoke OLAP app. The core idea is to have one process like a memory bank which contains all the data, and multiple worker processes which actually do the calculation. While usually everything works very smoothely, from time to time there is a performance hiccup when a worker tries to create a view on a part of a file which has not been used for a while - hence my question.

Amount of RAM is not a problem (Windows/64 bit) - we just do not know whether it is possible to stop the system from using a page file.

Was it helpful?

Solution

You are probably looking for the VirtualLock function.

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.

Caveat lector.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top