Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

iOS 10 Screencast: Memory Graph Debugger

Discover how to find retain cycles and memory leaks using Xcode 8's new memory graph debugger.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4973-ios-10-memory-graph-debugger

i downloaded the materials and was frustrated to discover that all the errors are already repaired in these materials, rendering the lesson moot. perhaps have a “before” and “after” set of materials?

Hi @dkliman

Unlike courses, screencasts are not really designed to be follow-along pieces of work. Instead, they introduce a topic, and give enough information to allow viewers to understand the concepts and common use cases of the tech in question.

Most screencasts benefit from having the completed project to allow you to see the code added in full context. This screencast is a little different, and maybe shouldn’t have had any attached sample code at all.

Hope that clears up the motivation behind screencasts, and explains why they aren’t the same as courses.

sam

Hey, I can’t jump to the place in code where the object was created. All of the memory addresses in the backtrace are greyed out. Did i miss something? Using swift 3 and Xcode 8.1.

Hiya @trouge

I’m not too sure. I think there’s a scheme setting required to enable memory graph debugging - did you set that?

sam

Hey @samdavies,

I think this is a bug in Xcode 8.1 where the backtrace isn’t being symbolicated.
There’s already a forum for it here.

Thanks,

Tyko

1 Like

@trouge

Well spotted! I’ve not tried it in Xcode 8.1, and it seems that I should be glad that I haven’t! Hopefully a fix with be forthcoming…

sam

Hi there @samdavies - I realise this video is from quite a while ago but when I searched for memory leaks iOS it was the top result. I have updated the materials to Swift 5 and recommended Xcode 13.2 settings here.

I’ve also added a branch that has the retain cycle and extra labels here so you can have a before and after set.

1 Like

Thank you @emwalks this is really good of you! Really nice of you to go to the effort and then share it on the forums for other people to learn from too.

Sadly, this screencast predates using GitHub repos for source code, so I can’t merge a PR, but I think what you’ve shared will be useful for new students.

Thanks again, and great work

sam