Monday, July 2, 2007

Mac OS X 最大进程数默认为100

有时候会出现"fork: Resource temporarily unavailable" 或者 "tcsh: no more processes" 的错误,是因为进程数达到最大值了。

运行%launchctl limit,输出:

        cpu         unlimited      unlimited      
        filesize    unlimited      unlimited      
        data        6291456        unlimited      
        stack       8388608        67108864       
        core        0              unlimited      
        rss         unlimited      unlimited      
        memlock     unlimited      unlimited      
        maxproc     100            532            
        maxfiles    256            unlimited     

To change this you need to create /etc/launchd.conf file if it does not already exist and add the following line:

limit maxproc 512 2048

The first number is the soft limit and the second number is the hard limit. You can pick different values if you want.




0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home