Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Memory Leak on Andriod - GDG LA July 2016
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aaron He
July 28, 2016
Technology
51
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
220
There's No Magic - How Kotlin can be your best friends @DevFest LA 2017
aaronhe
0
49
Google I/O '17 recap - GDG LA May 2017 Android@Tinder
aaronhe
0
110
RxJava for Android - GDG DevFest LA 2016
aaronhe
0
94
Auto Value and Its Extension GDG LA April
aaronhe
0
64
OkMVP
aaronhe
0
80
Other Decks in Technology
See All in Technology
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
130
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
310
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
200
Running Kotlin + Quarkus with Lambda
nealle
1
3.9k
React改造してみた
tsukina_7mochi
0
110
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
1
730
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
120
Browser Spec: Testing Hotwire with Ruby
takahashim
1
130
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
180
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
200
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.5k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
So, you think you're a good person
axbom
PRO
2
2.2k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Everyday Curiosity
cassininazir
0
360
エンジニアに許された特別な時間の終わり
watany
109
250k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Deep Space Network (abreviated)
tonyrice
0
370
Embracing the Ebb and Flow
colly
88
5.2k
Paper Plane (Part 1)
katiecoart
PRO
2
12k
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