Finding iOS Memory Leaks with Xcode's Instruments
spin.atomicobject.com
spin.atomicobject.com
I do wish the XCode developers would have implemented a more intuitive UI to do the same - e.g. taking inspiration from Chrome Developer Tools, or Visual Studio.
<rant> Actually, I would just be happy if XCode had the debugging features that Visual Studio 2005 (10 years ago) had. Like inspecting variables values with mouse over on breakpoints. Or when right clicking "refactor" in XCode on a method name, being able to refactor Swift code. 1 year after the release of Swift the error dialog "XCode can only refactor Objective C code" appears - so much for supporting the Apple's own language. </rant>
Anyway, article bookmarked - because even after reading this, there's no way I would remember all the steps needed to debug those memory leaks!
Pretty sure you can do this already
Alas, refactoring tool still does not work for Swift (this tells me Apple engineers must still be using Obj-C).
Yes, agreement on some Swift love needed from the refactor tool team.
There's actually event a "Leaks" template in the instruments app, I wondered why the author didn't use that. And that tool is even documented by apple, see
https://developer.apple.com/library/ios/documentation/Develo...
The author does mention it.
For what it's worth, I can't see what gregdoesit quoted in the article.
Where it fails is when memory is not freed because it's still referenced somewhere from your live objects, but shouldn't be. For example, if you keep adding subviews to a view and don't use the old ones anymore, expecting them to be destroyed but forgetting to remove them from their superview first.
Basically, Leaks is a garbage collector minus the collector, and where it fails is exactly where garbage collectors can fail and still allow leaks. Like any sensible garbage collector, it can handle cycles just fine.
(I know you just quoted it, but I thought this was a good place to address this weird aspect of the article.)
I just wish I didn't have to hack and guess my way around spritekit to fix it...