Memory leaks on Android: lessons learned and methodology
summary
Practical method to find and fix Android memory leaks using LeakCanary and Android Profiler: run LeakCanary (it waits 5 seconds then performs a heap dump), inspect GC root reference chains, and prefer fixing the parent object rather than removing references everywhere. Gives a numeric rule that 90% of leaks are due to incorrect lifecycle handling, shows concrete examples (uncancelled coroutines, a View held by a thread), and provides a demo app with verified fixes.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 0:29Java memory basics
- 2:12Android memory & GC
- 4:40What is a memory leak
- 6:46Leaks impact UX
- 7:06Detecting leaks method
- 9:13Fix via parent object
- 9:53Memory Profiler tool
- 10:55LeakCanary detection
- 13:02Practice: find leaks
- 15:30Case: coroutine leak
- 17:57LeakCanary analysis
- 19:02Best practices
- 20:27Resources & conclusion
- 21:30Q&A
related talks
47mLeakCanary, and Then? Unraveling Android Memory Leaks
34mMemory Leaks & Performance Considerations: A Cookbook
35mA small leak can sink a great ship
53mMemory on Android, Leaks and OOM
23mReducing memory footprint of your app - what LeakCanary is not telling you about
41mWays to reduce your app’s memory and storage footprint
37mUniversal heap trimming with LeakCanary 3
42mPerformance Paradox: Navigating the Complexities of Mobile App Optimisation
