I don't know if SO or SF is the right place for that kind of question but I think it is something you could achieve with code.
I have a program that requires much memory, like 2/3 of all the physical ram. After some runtime my operating system begins to swap the program to hdd. But I need the program to respond very fast all the time, so I need to prevent paging for that process.
How can you prevent the OS to swap one process?
Thanks for any help!
Solution
//main.cpp
include <sys/mman.h>
[...]
int main(int argc, char *argv[]) {
mlockall(MCL_CURRENT | MCL_FUTURE);
[...]
}