It seem's that OSX has been causing me some more headaches, I've been toying with git-annex which is interesting and useful for managing a bunch of large files with git. I had kept running into errors such as the following when one runs the tests for git-annex

### Error in:   1:blackbox:13:git-annex migrate:1
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:14:git-annex unused/dropunused                             
### Error in:   1:blackbox:14:git-annex unused/dropunused
forkProcess: resource exhausted (Resource temporarily unavailable)

This was a result of the low limit set by default for the maximum allowed processes in the system and per user. If you do a ulimit -a you can find out what the limit is, it's usually 266 for a normal user.

As a result I had googled up the problem and found that all I needed to do was something like this...

# this is really for the run time, you can set these settings in /etc/sysctl.conf
sudo sysctl -w kern.maxproc=2048
sudo sysctl -w kern.maxprocperuid=1024

# tell launchd about having higher limits
sudo echo "limit maxfiles 1024 unlimited" >> /etc/launchd.conf
sudo echo "limit maxproc 1024 2048" >> /etc/launchd.conf

Then ideally reboot, since I have no idea on how to restart launchd for myself to get it to inherit the new settings as such shell would have been a child process of launchd. Most users probably won't run into this limit, but I think most heavy and power users coming from a Linux background probably will come across this at some point. If only Apple made this limit higher it would be great, or else make it dynamic.

Bookmark and Share