fork: Resource temporarily unavailable

Discussion in 'Mac OS X Lion (10.7)' started by Tex-Twil, Jul 20, 2012.

  1. macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #1
    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?
     
  2. macrumors regular

    Joined:
    Jun 26, 2012
    #2
    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.
     
  3. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #3
    ok I'll try that when it happens again
     
  4. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #4
    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
     
  5. macrumors regular

    Joined:
    Jun 26, 2012
    #5
    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.
     
  6. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #6
    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.
     
  7. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #7
    It's still happening (mostly after working with git projects) :(
     
  8. macrumors regular

    Joined:
    Jun 26, 2012
    #8
  9. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #9
  10. macrumors regular

    Joined:
    Jun 26, 2012
    #10
    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.
     
  11. thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #11
    ok, I will try that
     

Share This Page