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
Memory Management in iOS App Development
Search
Sumin Byeon
September 03, 2009
Programming
0
110
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
51
Big Data in Action
suminb
1
65
Git with Bitbucket
suminb
0
89
RNA Secondary Structure Prediction
suminb
0
140
Other Decks in Programming
See All in Programming
Being an ethical software engineer
xgouchet
PRO
0
210
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
480
Go1.24 go vetとtestsアナライザ
kuro_kurorrr
2
840
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.5k
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
1k
remix + cloudflare workers (DO) docker上でいい感じに開発する
yoshidatomoaki
0
130
Defying Front-End Inertia: Inertia.js on Rails
skryukov
0
460
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
3
1.2k
生成AIを使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
200
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
320
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
220
国漢文混用体からHolloまで
minhee
1
180
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Become a Pro
speakerdeck
PRO
27
5.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Optimizing for Happiness
mojombo
377
70k
Unsuck your backbone
ammeep
670
57k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Speed Design
sergeychernyshev
29
880
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
13
1.4k
Scaling GitHub
holman
459
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.5k
Rails Girls Zürich Keynote
gr2m
94
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
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?