Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Instruments: Leaks by Trevor Brown
Search
Triangle Cocoa
September 27, 2012
Programming
5
150
Instruments: Leaks by Trevor Brown
Trevor discusses using the leaks tool in Instruments from CocoaHeads September in Durham
Triangle Cocoa
September 27, 2012
Tweet
Share
More Decks by Triangle Cocoa
See All by Triangle Cocoa
App Store Secrets by Lawrence Ingraham
trianglecocoa
1
290
iPhone 5 and You! by Ameir Al-Zoubi
trianglecocoa
0
180
Grand Central Dispatch by Jody Hagins
trianglecocoa
2
480
Foundation Collections by Kevin Conner
trianglecocoa
3
260
Multithreaded Drawing by Eric Lanz
trianglecocoa
3
220
Unburdened ViewControllers by Jay Thrash
trianglecocoa
9
11k
Automated Acceptance Testing by Josh Johnson
trianglecocoa
4
180
Understanding UIResponder by Dirk Smith
trianglecocoa
5
320
Taming Xcode by Jay Thrash
trianglecocoa
3
150
Other Decks in Programming
See All in Programming
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
190
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
160
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.2k
CSC305 Lecture 10
javiergs
PRO
0
270
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
34k
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
980
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
2
1.6k
Claude Agent SDK を使ってみよう
hyshu
0
1.4k
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.5k
AI駆動で0→1をやって見えた光と伸びしろ
passion0102
1
860
Google Opalで使える37のライブラリ
mickey_kubo
3
150
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
2
730
Featured
See All Featured
KATA
mclloyd
PRO
32
15k
Making Projects Easy
brettharned
120
6.4k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
A designer walks into a library…
pauljervisheath
209
24k
Embracing the Ebb and Flow
colly
88
4.9k
Statistics for Hackers
jakevdp
799
220k
Being A Developer After 40
akosma
91
590k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The World Runs on Bad Software
bkeepers
PRO
72
11k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Transcript
INSTRUMENTS: LEAKS Trevor Brown Triangle CocoaHeads September 2012
What are leaks? How can we detect them? How can
we prevent them? Q&A Resources
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)
HOW CAN WE DETECT LEAKS? Static Analyzer (Xcode) Instruments Code
review
Launch your app with the profiler
None
None
None
None
None
Random audience member: “Thanks for the total waste of time,
Trevor. I use ARC. Like, all the time. Wow... Um, beer, anyone?”
RETAIN CYCLE
Object A Object B RETAIN CYCLE
None
LEAK PREVENTION Use ARC (convert) Avoid retain cycles (no strong-strong
relationships) Handle low-memory warnings from the OS Run the static analyzer
QUESTIONS?
RESOURCES Performing static code analysis Instruments User Guide ARC transition
notes
THANK YOU!