MacOSX-dev Digest, Vol 48, Issue 3

Chad Armstrong edenwaith at mac.com
Wed Dec 5 19:39:50 PST 2007


That's an interesting point, Scott.  I'll look into this further.  I  
noticed that Panther's kern.maxprocperuid is set to only 100, whereas  
Leopard is 266.  I'll need to also check other versions of Mac OS X  
and see how they might different.

The only problem with your suggestion is that each task is called  
sequentially.  One is called, and the next one will not start until  
the previous one has completed.  The PID continues to rise with each  
time the NSTask is launched, but there are not a bunch of tasks being  
called all at once.

Regards,

Chad

On Dec 5, 2007, at 2:00 PM, macosx-dev-request at omnigroup.com wrote:

>> I've done some research, but I cannot find anything which seems to
>> pin point this particular problem.  My guess is that this error is
>> being thrown when an NSTaskDidTerminateNotification is called after
>> the task is complete.  What I've been able to dig up on this
>> "notification exception" might be related to "too many files being
>> opened at once".
>
> I don't know the exact answer to your question, but there are two
> kernel settings which are relevant:
>
> $ sysctl kern.maxproc
> 532
>
> $ sysctl kern.maxprocperuid
> 266
>
> If you're launching all of these NSTasks simultaneously, it might be a
> problem. It's possible NSTask is somehow smarter about how it spawns
> processes on Leopard. You can manually override these values if you're
> working in a controlled setting.
>
>> In my code, I also do make one call to an NSMutableDictionary, which
>> does have a [NSDictionary setObject: forKey:] call, but that doesn't
>> seem to be the source of the problem since I eliminated that code,
>> and the problem persists.
>
> That could be some code getting called in the frameworks. You can
> trying breaking on the -[NSException raise] to see what's up.
>
>    - Scott



More information about the MacOSX-dev mailing list