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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top