EGOPOLY

Topics include: programming, Apple, Unix, gadgets, large-scale web sites and other nerdy stuff.

Not enough processes!

2005-05-04 10:18:50

In Tiger, each of the dashboard widgets is its own process. I had always been running close to the ragged limit of processes before, and dashboard put me over the top. Apparently there is a simple kernel parameter to increase the process limit.

Here is what you need in your /etc/sysctl.conf. (Or something like this. Maybe you need more, or not so much. This works for me, with 2GB of RAM.) The default Tiger values were (oddly) 532 and 100, respectively:

kern.maxproc=2048
kern.macprocperuid=512

And here are the commands you can run to update these parameters without rebooting:

% sysctl -w kern.maxproc=2048
% sysctl -w kern.maxprocperuid=512

You then also have to increase the limits on various daemons (in particular, WindowServer) to allow your user processes to exceed the default shell limit of 100. This is dangerous to do, but it does work. Detailed instructions are at macosxhints.

Thanks to Joseph Scott for writing about this on his web site! He rules.