On Jun 30, 2011, at 2:01 AM, Ken Thomases wrote:

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


That's kind of what I concluded -- that the FD is roughly the current number of file descriptors. I noticed that sometimes the FD shows -1, but that's only in a transient condition. I attribute that to Instruments not being able to keep up. It never settles down to -1. After a fair amount of application warm-up the FD shows 25 to 26. So, I assume I'm ok. The FD has a pattern similar to memory in use. It grows for a while when you start and use an application, then settles out to some value. If it grows continually I guess you have a problem. In order not to get a fire-hose amount of data, you can type in a file-name (or some other identifier) into the spotlight-like magnifier box in the lower right corner of the Instruments window. Then you are looking at only files of interest. Again this sort of works, but Instruments still may not show everything.

Jim Merkel_______________________________________________

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