0

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?

ritter
  • 7,447
  • 7
  • 51
  • 84
  • What are your resource limits? `mlock` limits by defaylt are _very_ small (a few bytes). – Mat May 18 '12 at 08:50
  • `getrlimit` reports `rlim_cur=65536` and `rlim_max=65536`. I set it to a higher value and called `setrlimit`. Another query shows that the limits were not changed. Should they be changeable? – ritter May 18 '12 at 09:14
  • Depends on the OS. There are soft and hard limits for this on Linux and the other Unix-like systems I know. How you change them depends on the system. – Mat May 18 '12 at 09:34

0 Answers0