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
130
0
Share
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
75
Git with Bitbucket
suminb
0
94
RNA Secondary Structure Prediction
suminb
0
170
Other Decks in Programming
See All in Programming
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
370
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
1.8k
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
280
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
190
Kingdom of the Machine
yui_knk
2
1.2k
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
120
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
230
🦞OpenClaw works with AWS
licux
1
300
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
870
JOAI2026 1st solution - heron0519 -
heron0519
0
160
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
700
Featured
See All Featured
Between Models and Reality
mayunak
3
270
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Why Our Code Smells
bkeepers
PRO
340
58k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
470
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
160
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
270
Music & Morning Musume
bryan
47
7.2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
How to Think Like a Performance Engineer
csswizardry
28
2.6k
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?