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
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Memory Management in iOS App Development
Sumin Byeon
September 03, 2009
More Decks by Sumin Byeon
See All by Sumin Byeon
Cartography 101
suminb
1
61
Big Data in Action
suminb
1
81
Git with Bitbucket
suminb
0
94
RNA Secondary Structure Prediction
suminb
0
170
Other Decks in Programming
See All in Programming
Oxlintのカスタムルールの現況
syumai
6
1.1k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
140
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
6
1.2k
Agentic UI
manfredsteyer
PRO
0
160
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
170
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
690
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
CSC307 Lecture 17
javiergs
PRO
0
320
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
30 Presentation Tips
portentint
PRO
1
320
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
320
Building an army of robots
kneath
306
46k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
How to Think Like a Performance Engineer
csswizardry
28
2.7k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
150
Git: the NoSQL Database
bkeepers
PRO
432
67k
Being A Developer After 40
akosma
91
590k
Paper Plane (Part 1)
katiecoart
PRO
0
9k
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?