Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fopen() works only in debugger




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >fopen() works only in debugger (From: Timothy Larkin <email@hidden>)
 >Re: fopen() works only in debugger (From: "John C. Randolph" <email@hidden>)
 >Re: fopen() works only in debugger (From: Timothy Larkin <email@hidden>)
 >Re: fopen() works only in debugger (From: John Stiles <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.