Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Memory Management in iOS App Development
Search
Sumin Byeon
September 03, 2009
Programming
0
120
Memory Management in iOS App Development
Sumin Byeon
September 03, 2009
Tweet
Share
More Decks by Sumin Byeon
See All by Sumin Byeon
Cartography 101
suminb
1
57
Big Data in Action
suminb
1
71
Git with Bitbucket
suminb
0
93
RNA Secondary Structure Prediction
suminb
0
160
Other Decks in Programming
See All in Programming
FluorTracer / RayTracingCamp11
kugimasa
0
230
dotfiles 式年遷宮 令和最新版
masawada
1
770
Integrating WordPress and Symfony
alexandresalome
0
150
これならできる!個人開発のすゝめ
tinykitten
PRO
0
100
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
400
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
7.2k
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
110
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
180
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
170
sbt 2
xuwei_k
0
290
エディターってAIで操作できるんだぜ
kis9a
0
720
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Designing for humans not robots
tammielis
254
26k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
730
Six Lessons from altMBA
skipperchong
29
4.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Transcript
Memory Management for iPhone Application Development Sumin Byeon (
[email protected]
)
Advanced Topic
Significance Limited memory (128MB, 256MB) No garbage collection No virtual
memory User experience
Related Functions alloc copy retain release autorelease
Alloc Allocates memory for an object, and returns it with
retain count of 1[1]. Almost equivalent to the new keyword in C+ +, Java, etc. [1] http:/ /developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html
Copy Makes a copy of an object, and return retain
count of 1.
Master Theorem #1 If you allocated it, you should release
it. If you didn’t explicitly allocate it, don’t release it.
Example ! NSString *str = [[NSString alloc] initWithCString:"Boom baby"]; !
NSLog(str); ! [str release];
Example ! NSString *str = [NSString stringWithCString:"Boom baby"]; ! NSLog(str);
Retain Increases the retain count of an object by 1.
Release Decreases the retain count of an object by 1.
Master Theorem #2 If an object is being retained by
something else, you may release it immediately. (e.g. [UIView addSubview:view])
Master Theorem #3 Don’t you dare call dealloc. Always call
release, and dealloc will be called when the retain count becomes zero.
Autorelease
Autorelease with Threads
Instruments Charles Magahern (
[email protected]
)
Questions?