fork: retry: Resource temporarily unavailable

user1260391 picture user1260391 · Aug 22, 2012 · Viewed 179.5k times · Source

I tried installing Intel MPI Benchmark on my computer and I got this error:

fork: retry: Resource temporarily unavailable

Then I received this error again when I ran ls and top command.

What is causing this error?

Configuration of my machine:

Dell precision T7500
Scientific Linux release 6.2 (Carbon)

Answer

Satish picture Satish · Aug 22, 2012

This is commonly caused by running out of file descriptors.

There is the systems total file descriptor limit, what do you get from the command:

sysctl fs.file-nr

This returns counts of file descriptors:

<in_use> <unused_but_allocated> <maximum>

To find out what a users file descriptor limit is run the commands:

sudo su - <username>
ulimit -Hn

To find out how many file descriptors are in use by a user run the command:

sudo lsof -u <username> 2>/dev/null | wc -l

So now if you are having a system file descriptor limit issue you will need to edit your /etc/sysctl.conf file and add, or modify it it already exists, a line with fs.file-max and set it to a value large enough to deal with the number of file descriptors you need and reboot.

fs.file-max = 204708