On Linux x86_64 when loading a shared library i get
dlopen error: "FILENAME" failed to map segment from shared object: Resource temporarily unavailable
The machine has 48 GiB host memory installed, no other user logged in. So, its likely not to be because of insufficient memory.
I load dozens of the shared libs tho.
The code goes like (very reduced setup). And yes mlockall
is on purpose:
#if _POSIX_MEMLOCK > 0
#warning "POSIX_MEMLOCK available"
#else
#error "POSIX_MEMLOCK needed. Aborting"
#endif
int main()
{
if (mlockall(MCL_FUTURE)) {
printf("error page-locking\n");
exit(1);
}
void *handle;
handle = dlopen( "filename.so" , RTLD_LAZY);
}
Any other limitations on page-locking?