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
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
51
Big Data in Action
suminb
1
66
Git with Bitbucket
suminb
0
90
RNA Secondary Structure Prediction
suminb
0
150
Other Decks in Programming
See All in Programming
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
2
240
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
130
ユーザーも開発者も悩ませない TV アプリ開発 ~Compose の内部実装から学ぶフォーカス制御~
taked137
0
190
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
570
為你自己學 Python - 冷知識篇
eddie
1
350
Rancher と Terraform
fufuhu
2
550
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
150
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
320
Testing Trophyは叫ばない
toms74209200
0
890
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.5k
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
We Have a Design System, Now What?
morganepeng
53
7.8k
Music & Morning Musume
bryan
46
6.8k
Statistics for Hackers
jakevdp
799
220k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Six Lessons from altMBA
skipperchong
28
4k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
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?