Re: fopen() works only in debugger
Re: fopen() works only in debugger
- Subject: Re: fopen() works only in debugger
- From: Darkshadow <email@hidden>
- Date: Sun, 4 Mar 2007 23:35:26 -0500
On Mar 4, 2007, at 10:36 PM, John Stiles wrote:
When running under the debugger, the max-open-files limit is
increased for some reason. You can increase the limit yourself with
the BSD call "setrlimit" and RLIMIT_NOFILE.
AFAICS there is no penalty to your app for increasing it to the
maximum value. I think it is just there so that runaway processes
die sooner.
For more info, /man setrlimit
You still have to be careful with doing that. It raises the limit,
but it's not infinite. If you haven't changed the limits on your
system, you can raise it to a total of 10,240. That's a lot of open
files, but you can still hit it.
I wrote about my experience with hitting this using kqueues on my
blog, you can read it if you wish:
<http:www.nightproductions.net/blog/2007/02/04/of-kqueues-and-max-
open-files/>
On Mar 3, 2007, at 2:16 PM, Timothy Larkin wrote:
I am working on a Foundation tool which calls fopen() from a class
method. It runs correctly under the debugger.
Timothy, since you seem to be hitting the max open files, are you
calling fclose() on the descriptors you open when you're done with
them? Are you opening these files in a tight loop, or anything like
that?
------------------------------------------------
Darkshadow
(aka Michael Nickerson)
http://www.nightproductions.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden