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
Extracts from "Memory Management for Android Apps"
Search
David Wu
July 06, 2011
Programming
0
140
Extracts from "Memory Management for Android Apps"
Extracts from "Memory Management for Android Apps"
David Wu
July 06, 2011
Tweet
Share
More Decks by David Wu
See All by David Wu
Development with Vert.x: an event-driven application framework for the JVM
wuman
1
250
My Trip to Google I/O 2013
wuman
1
100
A Deep Dive into Open Source Android Development
wuman
18
1.5k
Fancy Rich Text on Android - Using Roguso as an Example
wuman
2
320
Fancy Rich Text Editing on Android - Invited Open Source Software Foundation Talk
wuman
1
720
Improving Android Application Performance (Invited Talk at National Taiwan University)
wuman
5
160
Challenges of Building HTC Sense (O'Reilly Android Open Conference 2011)
wuman
0
140
Extracts from "Android Protips: Advanced Topics for Expert Android App Developers"
wuman
0
300
GTK+ Programming using Vala
wuman
0
280
Other Decks in Programming
See All in Programming
AI時代のUIはどこへ行く?
yusukebe
18
9k
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
290
私の後悔をAWS DMSで解決した話
hiramax
4
210
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
310
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
400
1から理解するWeb Push
dora1998
7
1.9k
Design Foundational Data Engineering Observability
sucitw
3
200
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
2k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
560
GitHubとGitLabとAWS CodePipelineでCI/CDを組み比べてみた
satoshi256kbyte
4
250
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
340
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Side Projects
sachag
455
43k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Art of Programming - Codeland 2020
erikaheidi
56
13k
Unsuck your backbone
ammeep
671
58k
Bash Introduction
62gerente
615
210k
Transcript
Extracts from "Memory Management for Android Apps" Taipei GTUG 20110706
Meetup (http://goo.gl/VdfLK) Original Presenter Patrick Dubroy @dubroy Extract Presenter David Wu @wuman blog.wu-man.com
2 @wuman David Wu
[email protected]
blog.wu-man.com
#tossug, #h4 HTC
3 In 10 Minutes...
4 Purpose Avoid OOM errors
5 Breakdown API Changes Heap size Garbage collection
Bitmap allocations Understanding heap usage Memory leaks Logcat Memory Analyzer (MAT)
6 Heap Size Heap size limits G1: 16MB
Droid: 24MB Nexus One: 32MB Xoom: 48MB ActivityManager.getMemoryClass()
7 Large Heaps <application android:name=”com.example.foobar” andorid:largeHeap=”true” … </application>
8 Garbage Collection
9 Garbage Collection
10 Garbage Collection
11 Garbage Collection
12 Garbage Collection < Gingerbread Stop-the-world Full
heap collection Pause times often > 100ms >= Gingerbread Concurrent (mostly) Partial collections Pause times usually < 5ms
13 Bitmaps (Old)
14 Bitmaps (New)
15 Memory Leaks
16 Logcat
17 Logcat
18 Logcat
19 Logcat
20 Logcat
21 Logcat
22 Heap Dumps Create with DDMS andorid.os.Debug.dumpHprofData()
Conversion hprof-conv orig.hprof converted.hprof Analyze with MAT
23 Shallow and Retained Heap
24 Dominator Tree
25 Demo Debugging a memory leak with MAT
26 Demo
27 References Video of the session http://goo.gl/KRrx7 Original
slides http://goo.gl/0RqIZ Patrick Dubroy's blog http://dubroy.com/blog/