Re: Cocoa class extension best practice
Re: Cocoa class extension best practice
- Subject: Re: Cocoa class extension best practice
- From: Greg Parker <email@hidden>
- Date: Wed, 16 Oct 2013 01:18:18 -0700
On Oct 15, 2013, at 9:13 PM, Steve Mills <email@hidden> wrote:
> Here's a typical stack for most of the calls to itemArray:
>
> 0 libsystem_c.dylib calloc
> 1 libobjc.A.dylib _class_createInstanceFromZone
> 2 libobjc.A.dylib _class_createInstance
> 3 CoreFoundation __CFAllocateObject2
> 4 CoreFoundation +[__NSArrayI __new:::]
> 5 CoreFoundation -[__NSPlaceholderArray initWithObjects:count:]
> 6 CoreFoundation -[NSArray initWithArray:range:copyItems:]
> 7 CoreFoundation -[NSArray initWithArray:copyItems:]
> 8 CoreFoundation -[__NSArrayM copyWithZone:]
> 9 libobjc.A.dylib -[NSObject copy]
> 10 AppKit -[NSMenu itemArray]
> 11 Finale 2014 -[NSMenu(FCExtensions) itemWithTag:searchSubmenus:depthFirst:]
> 12 Finale 2014 -[NSMenu(FCExtensions) itemWithTag:searchSubmenus:depthFirst:]
> 13 Finale 2014 -[NSMenu(FCExtensions) itemWithTag:searchSubmenus:depthFirst:]
> 14 Finale 2014 -[NSMenu(FCExtensions) itemWithTag:searchSubmenus:]
> 15 Finale 2014 MenuEnable(EMENU, long, bool)
> 16 Finale 2014 FinPlugIn::AdjustMenuItems(EMENU, bool) const
> 17 Finale 2014 FinPlugInList::AdjustMenuItems(EMENU, bool) const
> 18 Finale 2014 FXMI_AdjustMenuItems(EMENU, bool)
> 19 Finale 2014 -[FinaleAppDelegate validateMenuItem:]
> 20 AppKit -[NSMenu _enableItem:]
> 21 AppKit -[NSMenu _enableItems]
> 22 AppKit -[NSMenu update]
>
> This is running our release target. Zombies is off. Am I just not reading this data correctly? These do NOT appear as leaks in the Leaks instrument, only as allocations in the Allocations instrument. If I run this particular code over and over, I can watch the app's memory footprint grow steadily, yet Leaks shows nothing out of the ordinary.
Instruments can give you the backtrace of every retain and release and autorelease call for that array object. What does it say?
You can call +[NSAutoreleasePool showPools] from the debugger to log the autorelease pool stack to the console (check both the debugger console and Console.app). That may point out if your objects are stuck in an autorelease pool that hasn't been drained.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden