I work with Terminal a lot, and often have 30 to 40 windows open, each running my shell and ssh. Add in all the other processes, and I quickly exceed the 100 maxprocperuid limit that OS X defaults to.
There have been many proposed solutions to this. You can, for instance, in your shell startup scripts override the limit for that shell instance, and you can run more than 100 processes from that shell, but when you launch a new window, the parent process that launches all apps for you in the GUI is still limited to that 100 process per user limit, and the new window will fail to launch your shell. It usually fails with the error: login: fork: Resource temporarily unavailable.
There are two phases to fixing this problem. First you must change the overall OS limits for maxproc and maxprocperuid to higher values, and then you must make WindowServer run in an environment with the limits raised.
[robg adds: I have not tested this one, nor do I intend to! If you're going to experiment with it, I recommend you have a good backup first, just in case...]
System Wide
OS X 10.3 now supports the standard /etc/sysctl.conf. This means you can just put new values into this file and reboot. This is what the file looks like:
% cat /etc/sysctl.conf <br>
# Turn up maxproc <br>
kern.maxproc=2048 <br>
# Turn up the maxproc per user <br>
kern.maxprocperuid=512 <br>
Daemons /etc/rc.common
Here is a snippet of the top of my /etc/rc.common file:
#######################
# Configure the shell #
#######################
ulimit -u 512
##
# Be strict
##
WindowServer% cd /System/Library/Frameworks/ % cd ApplicationServices.framework/Frameworks/ % cd CoreGraphics.framework/Resources/robg adds: Yes, you can do that as one long cd command; I snipped it apart for narrower display width.
#!/bin/zsh ulimit -u 384 /System/Library/Frameworks/ApplicationServices.framework/ Frameworks/CoreGraphics.framework/Resources/WindowServer.orig $*
Mac OS X Hints
http://hints.macworld.com/article.php?story=200311151254441