Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin
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?
 

appletechpro

macrumors regular
Jun 26, 2012
111
0
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?

It'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.
 

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin
It'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.
ok I'll try that when it happens again
 

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin
It has happened again but the problem is that I cannot open new applications to do what you suggested.

This time it happened on my other MBP (also 8GB). It occurs when I am building several times this library http://libmailcore.com/

Btw, what do you mean by "examine the sysctl values"

cheers
 

appletechpro

macrumors regular
Jun 26, 2012
111
0
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.
 

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin
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.

currently it is
Code:
sudo sysctl -a|grep maxprocperuid
Password:
kern.maxprocperuid = 709
kern.maxprocperuid: 709
I set it to 800. Let's see if that help.
 

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin

appletechpro

macrumors regular
Jun 26, 2012
111
0
My current values are of maxproc and maxprocperuid are:



this is even bigger that what the tutorial suggests.

What the tutorial suggests will vary upon the workload.

Just because a certain process limit worked for that user doesn't mean the same process limit would work for your environment.

Thus, I might suggest upgrading the value to something extremely large (such as 3,000) so that you can rule out process limits as the culprit.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.