Linux 叉:重试:资源暂时不可用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12079087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
fork: retry: Resource temporarily unavailable
提问by user1260391
I tried installing Intel MPI Benchmark on my computer and I got this error:
我尝试在我的计算机上安装 Intel MPI Benchmark,但出现此错误:
fork: retry: Resource temporarily unavailable
Then I received this error again when I ran ls
and top
command.
然后我在运行ls
和top
命令时再次收到此错误。
What is causing this error?
是什么导致了这个错误?
Configuration of my machine:
我的机器配置:
Dell precision T7500
Scientific Linux release 6.2 (Carbon)
回答by Satish
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.
因此,现在如果您遇到系统文件描述符限制问题,则需要编辑 /etc/sysctl.conf 文件并添加或修改它已经存在的 fs.file-max 行并将其设置为大值足以处理您需要的文件描述符数量并重新启动。
fs.file-max = 204708
回答by Satish
Another possibility is too many threads. We just ran into this error message when running a test harness against an app that uses a thread pool. We used
另一种可能是线程太多。在针对使用线程池的应用程序运行测试工具时,我们刚刚遇到此错误消息。我们用了
watch -n 5 -d "ps -eL <java_pid> | wc -l"
to watch the ongoing count of Linux native threads running within the given Java process ID. After this hit about 1,000 (for us--YMMV), we started getting the error message you mention.
观察在给定 Java 进程 ID 中运行的 Linux 本机线程的持续计数。在达到大约 1,000(对我们而言 - YMMV)之后,我们开始收到您提到的错误消息。