Artwork

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!

115: Do the Weak-Strong Dance

56:30
 
Share
 

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

  continue reading

100 episodes

Artwork
iconShare
 
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

  continue reading

100 episodes

All episodes

×
 
Loading …

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.

 

Quick Reference Guide