Re: MacOSX-dev Digest, Vol 48, Issue 3

  • 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...> 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
  • On 6 Dec 2007, at 03:39, Chad Armstrong wrote:

    > 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.

    Does your code call -waitUntilExit on the NSTasks?  At the underlying
    UNIX layer, if you don't check the exit status, you will end up with
    zombie processes that still take up process table entries.

    If you want to check for this problem, you can do so by looking at the
    output of the "ps x" command in Terminal.  The STAT column will show
    "Z" for zombie processes.

    Kind regards,

    Alastair.

    --
    http://alastairs-place.net
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today