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 Leak on Andriod - GDG LA July 2016
Search
Aaron He
July 28, 2016
Technology
45
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Memory Leak on Andriod - GDG LA July 2016
Aaron He
July 28, 2016
More Decks by Aaron He
See All by Aaron He
Road to Modularization(DroidCon NYC 2019)
aaronhe
1
200
There's No Magic - How Kotlin can be your best friends @DevFest LA 2017
aaronhe
0
34
Google I/O '17 recap - GDG LA May 2017 Android@Tinder
aaronhe
0
98
RxJava for Android - GDG DevFest LA 2016
aaronhe
0
85
Auto Value and Its Extension GDG LA April
aaronhe
0
57
OkMVP
aaronhe
0
72
Other Decks in Technology
See All in Technology
4人目のSREはAgent
tanimuyk
0
360
AWS Blocks を触ってみた/first-tach-aws-blocks
fossamagna
2
110
AI時代における最適なQA組織の作り方
ymty
3
330
Why is RC4 still being used?
tamaiyutaro
0
270
クラウドファンディング版StackChan 3体(4体)をインタラクティブな体験型作品にして展示もした話 / スタックチャンお誕生日会2026
you
PRO
0
270
LiDAR SLAMの実装とセンサ融合 ~Lie群からContinuous-Time LIOまで~
naokiakai
1
800
知見・人・API・DB・予算 ─ ナイナイ尽くしだった人事データ整備 with dbt、5年間の学び
ken6377
1
120
はてなのサービス基盤を支える Kubernetes《足腰》
masayoshimaezawa
0
400
AI駆動開発におけるQAエンジニアの役割事例 〜AI駆動開発の現場から〜
kobayashiyorimitsu
0
220
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.7k
サイバーエージェントにおけるAI推進戦略と変革への取り組み
shotatsuge
0
680
cccccc
moznion
0
670
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Embracing the Ebb and Flow
colly
88
5.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Test your architecture with Archunit
thirion
1
2.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Git: the NoSQL Database
bkeepers
PRO
432
67k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
The SEO Collaboration Effect
kristinabergwall1
1
500
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Code Reviewing Like a Champion
maltzj
528
40k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Transcript
Memory Leak on Android Aaron He
Out of memory error Fatal Exception: java.lang.OutOfMemoryError Fail to allocate
a x byte allocation with y free bytes until OOM
Heap
Causes of OOM • View pager inception • Bitmaps •
Library designed for Java not Android • Or…
Memory leak
Wait a sec…
Not if you are like this cat
How memory leaks • The reference to the root outlives
the root’s lifecycle. Activity/Context leak Listeners Be aware of anonymous class Android framework
Tools to help • Eclipse Memory Analyzer • LeakCanary •
Android Studio Memory Monitor
Eclipse Memory Analyzer • Dump HPROF in DDMS • Convert
it to J2SE format • Start analyzing! OQL
LeakCanary • HAHA(Headless Android Heap Analyzer): https:// github.com/square/haha • LeakCanary:
https://github.com/square/leakcanary • Customization
Demo!
Memory Monitor in AS Initiate GC Dump Heap Allocation tracker
Memory usage
Demo!
References • Managing Your App’s Memory: https://developer.android.com/training/ articles/memory.html • Managing
Bitmap Memory: https://developer.android.com/training/ displaying-bitmaps/manage-memory.html • Joda Time’s Memory Issue in Android: http://blog.danlew.net/2013/08/20/ joda_time_s_memory_issue_in_android/ • Eclipse Memory Analyzer: http://www.eclipse.org/mat/ • Detect all memory leaks with LeakCanary: https://youtu.be/mU1VcKx8Wzw • Android Studio Memory Monitor: https://developer.android.com/studio/ profile/am-memory.html
Thank you!
[email protected]
@aaronhe42