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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
59
Big Data in Action
suminb
1
73
Git with Bitbucket
suminb
0
94
RNA Secondary Structure Prediction
suminb
0
160
Other Decks in Programming
See All in Programming
20260315 AWSなんもわからん🥲
chiilog
2
180
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
310
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
Understanding Apache Lucene - More than just full-text search
spinscale
0
150
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
140
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
290
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
770
PHPで TLSのプロトコルを実装してみる
higaki_program
0
680
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
250
Coding as Prompting Since 2025
ragingwind
0
620
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
240
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
280
Featured
See All Featured
The Language of Interfaces
destraynor
162
26k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
290
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
320
Evolving SEO for Evolving Search Engines
ryanjones
0
170
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
250
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
940
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?