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
53
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
Transcript
16 slides
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
More Decks by Aaron He
See All by Aaron He
Road to Modularization(DroidCon NYC 2019)
aaronhe
1
230
There's No Magic - How Kotlin can be your best friends @DevFest LA 2017
aaronhe
0
52
Google I/O '17 recap - GDG LA May 2017 Android@Tinder
aaronhe
0
110
RxJava for Android - GDG DevFest LA 2016
aaronhe
0
97
Auto Value and Its Extension GDG LA April
aaronhe
0
70
OkMVP
aaronhe
0
87
Other Decks in Technology
See All in Technology
メール到達性を支える、リンク先URLのドメイン評価の扱い方
wind111
0
200
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
150
現地速報! Microsoft Ignite アップデートレポート
kasada
1
470
メルカリの小規模チーム「Pod」で、 エンジニアがデータアナリストなしで、 AIを使ってデータ分析の自走を目指す取り組み
jackojacko_
1
360
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
280
Go でトランザクション、どう書いてますか?
knwoop
2
630
Welcome JXL!
dynamis
0
330
New Relicのアラート対応をClaude Codeで自動修正するワークフローを作った話
manabuseki
3
680
AWS re:Invent 2026 FSI Pre-Event Networking Night
junjikoide
0
270
2026-11-16 JAWS-UG コンテナ支部 #31 ゆるLT大会 ECR のライフサイクルポリシーを いい感じに設定したい / ECR Lifecycle policy
masasuzu
3
630
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
2
480
お風呂場をサーバルームにしよう
yusuke427
0
400
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
GitHub's CSS Performance
jonrohan
1033
470k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Facilitating Awesome Meetings
lara
57
7.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
610
The Curious Case for Waylosing
cassininazir
1
630
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
760
Building Applications with DynamoDB
mza
96
7.3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
320
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4k