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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
94
RNA Secondary Structure Prediction
suminb
0
160
Other Decks in Programming
See All in Programming
2026年 エンジニアリング自己学習法
yumechi
0
130
ThorVG Viewer In VS Code
nors
0
770
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
210
Oxlintはいいぞ
yug1224
5
1.3k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
170
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
SourceGeneratorのススメ
htkym
0
190
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
110
CSC307 Lecture 07
javiergs
PRO
0
550
Fluid Templating in TYPO3 14
s2b
0
130
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
270
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
92
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
How GitHub (no longer) Works
holman
316
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
Test your architecture with Archunit
thirion
1
2.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
90
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Exploring anti-patterns in Rails
aemeredith
2
250
Utilizing Notion as your number one productivity tool
mfonobong
3
220
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?