2 ms·
Presumably, one can still lock down pages in memory (https://www.freebsd.org/cgi/man.cgi?query=mlock https://www.freebsd.org/cgi/man.cgi?query=mlock, http://man
by Someone 8y ago
Presumably, one can still lock down pages in memory (https://www.freebsd.org/cgi/man.cgi?query=mlock https://www.freebsd.org/cgi/man.cgi?query=mlock, http://man7.org/linux/man-pages/man2/mlock.2.html http://man7.org/linux/man-pages/man2/mlock.2.html).
So, build default data structures as if everything is swapped out, and add structures designed for use in memory for caching that data.
Alternatively, only use structures optimized for in memory use, and trust your OS to keep the active set paged in (easier, but can harm performance if you have much more data than RAM)