Hi,
quite often after some hours of work (XCode, git), I cannot execute any commands from bash and I got this error:
Code:fork: Resource temporarily unavailable
I have 8GB ram (60-70% used) on a MBP 2011.
What is going on?
ok I'll try that when it happens againIt's possible the kernel is reaching some sort of sysctl limit.
My suggestion would be to dump the full process list at the time of occurrence, examine the processes one by one to see if you can find any information and examine the sysctl values on your machine.
Before the issue occurs, enter the following commands in Terminal:
sudo sysctl -a|grep maxprocperuid
^ That will return the process limit for your user.
sudo sysctl -w kern.maxprocperuid=800
^ That will increase your user process limit to 800, for instance.
sudo sysctl -a|grep maxprocperuid
Password:
kern.maxprocperuid = 709
kern.maxprocperuid: 709
I am confident that is the problem. Try increasing the value further.
http://blog.ghostinthemachines.com/2010/01/19/mac-os-x-fork-resource-temporarily-unavailable/
$ sysctl -a | grep maxproc | grep =
kern.maxproc = 1064
kern.maxprocperuid = 709
$ ulimit
unlimited
My current values are of maxproc and maxprocperuid are:
this is even bigger that what the tutorial suggests.