Getting strange behavior from terminal and iTerm “-bash: fork: Resource temporarily unavailable”

前端 未结 4 1973
长情又很酷
长情又很酷 2020-12-31 05:58

When I open iTerm, I\'m getting this message:

Last login: Mon Oct 22 12:20:25 on ttys002
-bash: fork: Resource temporarily unavailable
-

相关标签:
4条回答
  • 2020-12-31 06:20

    To resolve on Yosemite and newer versions of Mac OS, use https://superuser.com/a/838630. I was able to resolve by updating the plist files and rebooting - the ulimit commands were unnecessary.

    0 讨论(0)
  • 2020-12-31 06:36

    See setting higher limits on the number of processes.

    http://blog.ghostinthemachines.com/2010/01/19/mac-os-x-fork-resource-temporarily-unavailable/

    0 讨论(0)
  • 2020-12-31 06:37

    bash - and all the other shells, too - use the fork system call on Unix systems in order to actually create the process that you want to launch from the shell. In this case, bash tells you that the system call ended with Resource temporarily unavailable, which translates to the errno value of 11, which is equal to EAGAIN.

    The manual page for fork says that it may set errno to EAGAIN when :

    • It cannot allocate sufficient memory to copy the parent's page tables and allocate a task structure for the child.
    • It was not possible to create a new process because the caller's RLIMIT_NPROC resource limit was encountered. To exceed this limit, the process must have either the CAP_SYS_ADMIN or the CAP_SYS_RESOURCE capability.

    In this case, I think that the first reason doesn't really sound realistic, unless you are actually out of memory, so I guess you just must've hit the limit for the number of running processes for your user.

    0 讨论(0)
  • 2020-12-31 06:39

    For iTerm, opening a new tab worked for me

    0 讨论(0)
提交回复
热议问题