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
74
Git with Bitbucket
suminb
0
94
RNA Secondary Structure Prediction
suminb
0
170
Other Decks in Programming
See All in Programming
Kingdom of the Machine
yui_knk
2
1k
PHPer、Cloudflare に引っ越す
suguruooki
1
110
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
720
Making the RBS Parser Faster
soutaro
0
560
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
170
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
590
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
120
AIエージェントで業務改善してみた
taku271
0
550
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
110
t *testing.T は どこからやってくるの?
otakakot
1
780
10 Tips of AWS ~Gen AI on AWS~
licux
5
480
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.2k
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
350
[SF Ruby Conf 2025] Rails X
palkan
2
980
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.2k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
320
Making the Leap to Tech Lead
cromwellryan
135
9.8k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
So, you think you're a good person
axbom
PRO
2
2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
200
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
170
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
120
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
110
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?