Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Instruments: Leaks by Trevor Brown

Instruments: Leaks by Trevor Brown

Trevor discusses using the leaks tool in Instruments from CocoaHeads September in Durham

Triangle Cocoa

September 27, 2012
Tweet

More Decks by Triangle Cocoa

Other Decks in Programming

Transcript

  1. What are leaks? How can we detect them? How can

    we prevent them? Q&A Resources
  2. Memory that... has been consumed (allocated), is no longer needed,

    but cannot be returned to the OS for reuse or accessed by the program that allocated it. Is there a problem with that? Waste of resources Slowdown (unresponsive) Unexpected shutdown by OS WHAT ARE LEAKS? (and why they’re bad)
  3. Random audience member: “Thanks for the total waste of time,

    Trevor. I use ARC. Like, all the time. Wow... Um, beer, anyone?”
  4. LEAK PREVENTION Use ARC (convert) Avoid retain cycles (no strong-strong

    relationships) Handle low-memory warnings from the OS Run the static analyzer