On Aug 18, 2009, at 7:25 AM, McLaughlin, Michael P. wrote:
1) With 1 CPU (NSOperation not used), I get 50% of CPU-time devoted to
auto_collection_thread which I presume means Garbage Collection. Is this
normal?  It seems excessive.

2) With 2 CPUs, I get 26% of CPU-time for auto_collection_thread and another
26% for mach_msg_trap --> CFRunLoopSpecific (apparently back to Carbon
again).

You may be reading the sampling results incorrectly. That 50% in auto_collection_thread and 26% in CFRunLoopRunSpecific are almost certainly time that those threads are waiting for something else to happen. The garbage collector is waiting for memory usage to go too high, and CFRunLoopRunSpecific is waiting for a user event or timer or I/O to arrive. These are normal - the GC thread and event loop spend most of their wall-clock time doing nothing in most programs.

The sampling tools grab stack traces every n milliseconds. A thread that is stopped waiting for something else to happen will show up in lots of those stack traces even though it's not using any CPU time. If the samples always hit in exactly the same place, it's likely that the thread is in fact doing nothing.


--
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________

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