The director’s commentary track for Daring Fireball. Long digressions on Apple, technology, design, movies, and more.
…
continue reading
Content provided by 5by5 Broadcasting. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by 5by5 Broadcasting or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!
Go offline with the Player FM app!
115: Do the Weak-Strong Dance
MP3•Episode home
Manage episode 159029467 series 27172
Content provided by 5by5 Broadcasting. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by 5by5 Broadcasting or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Discussion - Allocations and Leaks instruments
- Extraordinarily hard to spot
Tough to find offending code without help from tools
Unbounded Memory Growth (memory growth without a chance to collect (deallocate) memory
True Leaks (retain cycles)
Allocations
- Generation Analysis
- Tracks allocations still resident when the generation is marked
- As you do multiple generations you will see only the new allocations since the last generations
- Simulate Memory Warning (did it help, do you have anything observing for this?)
- I have unbounded memory growth, now what?
- Look for the biggest offenders (sorting) - Drill into the code and look for ways to release unnecessary allocations
- Good ‘ol fashion memory management
- If you’re intentionally holding onto objects, consider implementing an observer for UIApplicationDidReceiveMemoryWarningNotification to release them
Leaks / Retain Cycles aka. Strong Reference Cycles
- Persistent vs. Transient
- Static Code Analyis
- Narrow list to your code
- Use / Observe (detective work)
- “You’re in the ballpark” now what?
- Reference counting
- Weak and Unowned
- Closure example with capture list; weak and unowned
- Apple says, “Use a weak reference whenever it is valid for that reference to become nil at some point during its lifetime. Use an unowned reference when you know that the reference will never be nil once it has been set during initialization.”
Picks
Darryl
- Visual Debugging with Xcode WWDC 2016 Session 410 demonstrates the use of the new Memory Graph Debugger starting at about 24 minutes in
John
- "Weak, Strong, Unowned, Oh My!" - a Guide to References in Swift by Hector Matos
100 episodes
MP3•Episode home
Manage episode 159029467 series 27172
Content provided by 5by5 Broadcasting. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by 5by5 Broadcasting or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Discussion - Allocations and Leaks instruments
- Extraordinarily hard to spot
Tough to find offending code without help from tools
Unbounded Memory Growth (memory growth without a chance to collect (deallocate) memory
True Leaks (retain cycles)
Allocations
- Generation Analysis
- Tracks allocations still resident when the generation is marked
- As you do multiple generations you will see only the new allocations since the last generations
- Simulate Memory Warning (did it help, do you have anything observing for this?)
- I have unbounded memory growth, now what?
- Look for the biggest offenders (sorting) - Drill into the code and look for ways to release unnecessary allocations
- Good ‘ol fashion memory management
- If you’re intentionally holding onto objects, consider implementing an observer for UIApplicationDidReceiveMemoryWarningNotification to release them
Leaks / Retain Cycles aka. Strong Reference Cycles
- Persistent vs. Transient
- Static Code Analyis
- Narrow list to your code
- Use / Observe (detective work)
- “You’re in the ballpark” now what?
- Reference counting
- Weak and Unowned
- Closure example with capture list; weak and unowned
- Apple says, “Use a weak reference whenever it is valid for that reference to become nil at some point during its lifetime. Use an unowned reference when you know that the reference will never be nil once it has been set during initialization.”
Picks
Darryl
- Visual Debugging with Xcode WWDC 2016 Session 410 demonstrates the use of the new Memory Graph Debugger starting at about 24 minutes in
John
- "Weak, Strong, Unowned, Oh My!" - a Guide to References in Swift by Hector Matos
100 episodes
All episodes
×Welcome to Player FM!
Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.