Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Memory Leak on Andriod - GDG LA July 2016

Memory Leak on Andriod - GDG LA July 2016

Aaron He

July 28, 2016
Tweet

More Decks by Aaron He

Other Decks in Technology

Transcript

  1. Causes of OOM • View pager inception • Bitmaps •

    Library designed for Java not Android • Or…
  2. How memory leaks • The reference to the root outlives

    the root’s lifecycle. Activity/Context leak Listeners Be aware of anonymous class Android framework
  3. Eclipse Memory Analyzer • Dump HPROF in DDMS • Convert

    it to J2SE format • Start analyzing! OQL
  4. 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