Re: Can't obtain any more NSPipe instances
Re: Can't obtain any more NSPipe instances
- Subject: Re: Can't obtain any more NSPipe instances
- From: "Jordan Krushen" <email@hidden>
- Date: Sun, 28 May 2006 19:10:08 -0700
On 5/28/06, Alexander Reichstadt <email@hidden> wrote:
There is some odd behaviour with NSPipe I can't figure out, or maybe
it's with my code. The following demonstrates the problem; when
running the following code it always fails at iteration 246:
Here's a hint:
% ulimit -a
Don't change the limit, BTW. It's a useful warning that you're using
up more resources than necessary (unless you *really* need that many
concurrent open fds), and other users will have the default limit,
too.
NSPipe *pipe = [NSPipe pipe];
NSPipe *pipe = [[NSPipe alloc ] init];
[pipe release];
[task release];
Why does it fail at 246, is there anything I can do differently to
remove the limit of NSPipe instances I can obtain?
You're using autoreleased pipes without a local autorelease pool, so
they're accumulating. You could add a local pool, or just alloc/init
and manually release when you're done with them.
Try running it before and after the changes under ObjectAlloc, too
(Debug -> Launch Using Performance Tool -> ObjectAlloc). It can
graphically point out rapidly growing instances like this.
HTH,
J.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden