I'm using mmap to read/write a file that I'm using in a database-like way. The file is much larger than available RAM. My use case is single-process, multi-threaded. How can I maximize the performance of accessing the mmap'd memory?
I'm assuming I should use MAP_PRIVATE rather than MAP_SHARED to take advantage of copy-on-write.
Is there any performance advantage to using MAP_POPULATE and/or MAP_NONBLOCK?
Are there any other performance-related things I should consider when using mmap?