Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
57
Big Data in Action
suminb
1
71
Git with Bitbucket
suminb
0
93
RNA Secondary Structure Prediction
suminb
0
150
Other Decks in Programming
See All in Programming
connect-python: convenient protobuf RPC for Python
anuraaga
0
360
関数の挙動書き換える
takatofukui
4
770
[SF Ruby Conf 2025] Rails X
palkan
0
450
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
220
AIコーディングエージェント(skywork)
kondai24
0
120
CSC509 Lecture 14
javiergs
PRO
0
220
How Software Deployment tools have changed in the past 20 years
geshan
0
28k
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
320
認証・認可の基本を学ぼう前編
kouyuume
0
160
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
28
14k
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
150
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
The World Runs on Bad Software
bkeepers
PRO
72
12k
What's in a price? How to price your products and services
michaelherold
246
12k
Optimizing for Happiness
mojombo
379
70k
Automating Front-end Workflow
addyosmani
1371
200k
KATA
mclloyd
PRO
32
15k
Git: the NoSQL Database
bkeepers
PRO
432
66k
GitHub's CSS Performance
jonrohan
1032
470k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
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?