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
110
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
62
Git with Bitbucket
suminb
0
86
RNA Secondary Structure Prediction
suminb
0
120
Other Decks in Programming
See All in Programming
フロントエンドの現在地とこれから
koba04
0
800
M5Stackボードの選び方
tanakamasayuki
0
200
フロントエンドの標準仕様をどう追っているか / How I follow the frontend standards specs
petamoriken
2
170
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
1.2k
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
140
ROS 2のZenoh対応とZenohのROS 2対応
takasehideki
2
240
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
5
210
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
3
150
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
320
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
150
為醫療加裝Python的引擎
cclai999
0
270
Infrastructure as Code でセキュリティを楽にしよう!
konokenj
5
1.4k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
459
32k
Become a Pro
speakerdeck
PRO
24
4.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
279
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
403
65k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
The Invisible Side of Design
smashingmag
297
50k
Building a Modern Day E-commerce SEO Strategy
aleyda
37
6.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Docker and Python
trallard
40
3k
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?