On Jun 30, 2011, at 3:02 AM, Jean-Daniel Dupas wrote:

> Le 30 juin 2011 à 08:19, James Merkel a écrit :
> 
>> Ok, I'm looking at my application in Instruments File Activity. The column 
>> labeled FD I assume means file descriptors. Is that the total number of FDs 
>> in use at any given time?
> 
> No, Just like process ID, file descriptor number can be reused by the system.

That analogy is a bit flawed.  Process IDs are global across the system.  File 
descriptors are per-process.

> And there is absolutely no guarantee the system use simple incremental value 
> for fd AFAIK.

Actually, when a new file descriptor is created for your process, it does use 
the lowest unused descriptor number (except for dup2()).

Still, the File Activity instrument's event list isn't showing a count of file 
descriptors, it's showing the specific individual file descriptor involved in 
the specific event.  But there's a pretty good chance that the highest file 
descriptor you see across a significant range of events roughly indicates the 
count of open descriptors.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to