Limit buffer cache used for mmap

Viewed 2261

I have a data structure that I'd like to rework to page out on-demand. mmap seems like an easy way to run some initial experiments. However, I want to limit the amount of buffer cache that the mmap uses. The machine has enough memory to page the entire data structure into cache, but for test reasons (and some production reasons too) I don't want to allow it to do that.

Is there a way to limit the amount of buffer cache used by mmap?

Alternatively, an mmap alternative that can achieve something similar and still limit memory usage would work too.

4 Answers
Related