Currently I am debugging a program in linux that looks like this:
int main(){
loadHugeFile();
processTheDataOfTheFile();
return 0;
}
The thing is loadHugeFile
function needs to load a very huge file in gigabytes that takes about 5 minutes, while processTheDataOfTheFile
takes less than 10 seconds to calculate the required data and return some values. In the future, the file's size might increase even further, and it will take even more time to load. The file is an invert index, so the whole file is needed.
Is it possible to have one process load this file into the RAM, retain it and have any other process access this part of the loaded file? This is to skip that many minutes loading. I recall Windows has this function that allows you to access/modify another process's memory, but what are my available choices here in linux?