Re: ARC, Instruments and retain cycles
Re: ARC, Instruments and retain cycles
- Subject: Re: ARC, Instruments and retain cycles
- From: Roland King <email@hidden>
- Date: Sun, 08 Jan 2012 09:07:04 +0800
On Jan 8, 2012, at 1:15 AM, Matt Neuburg wrote:
> On Fri, 23 Dec 2011 12:58:50 +0800, Roland King <email@hidden> said:
>> Does anyone know anything about improved leak detection in instruments especially as it pertains to retain cycles?
>
> I don't know anything about "improved" because I don't know what it was like before. I can reliably make a retain cycle that Instruments does not report with its Leaks tool, as I describe in the Memory Management section of my book as revised for iOS 5; but this has to do with a block that refers to self being copied behind the scenes, and I'm not entirely surprised that Instruments can't keep up with that. On the other hand, ARC does sometimes warn of potential retain cycle due to a copied block (though it didn't in this instance), which I regard as right neighborly of it. m.
>
Mine was different - this was a cycle which was held by a KVO registration, because KVO observation registrations are kept in a global table. I've also found that if the only reference to your cycle is a weak reference, instruments doesn't find it. That one I filed as a bug as garbage collection, were you using that, would find the cycle was only weakly reachable and release it so I think Instruments should also spot the cycle is only weakly reachable and report it at least as a potential leak.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden