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
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
180
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
790
Build-to-own AI: Agentic Development for Humans
inesmontani
PRO
0
160
AIが無かった頃の素敵な出会いの話
codmoninc
1
360
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
200
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
560
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1.1k
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
200
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
210
Claude Team Plan導入・ガイド
tk3fftk
0
250
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
210
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
Code Reviewing Like a Champion
maltzj
528
40k
Designing for Performance
lara
611
70k
Believing is Seeing
oripsolob
1
180
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Fireside Chat
paigeccino
42
4k
How to build a perfect <img>
jonoalderson
1
5.8k
The Curious Case for Waylosing
cassininazir
1
440
Faster Mobile Websites
deanohume
310
32k
Evolving SEO for Evolving Search Engines
ryanjones
0
250
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
680
ラッコキーワード サービス紹介資料
rakko
1
4.2M
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?