Universal heap trimming with LeakCanary 3
summary
Adds a heap-diff detector to LeakCanary 3 that runs during automated scenarios (Espresso, Robolectric, UIAutomator or JVM tests) and takes periodic heap dumps, builds breadth-first traversal trees and diffs them to surface nodes whose outgoing references grow across iterations. Demo shows a JetNews analytics list growing across 10 iterations (detected as ~101 objects with new entries) and finds real issues in an app like Slack; tool is alpha and used in production testing at Block.
AI-written summary · about
chapters (11)
- 0:00LeakCanary introduction
- 7:32Memory growth impact
- 12:52Non-UI leak limits
- 14:42Heap trimming discovery
- 16:26Garbage collection basics
- 21:45Heap diffing in LeakCanary 3
- 23:08Live heap trimming demo
- 30:51Fixing real app leaks
- 33:22Slack app testing
- 35:50Call to action
- 36:55Q&A
related talks
37mRoot causing memory growth with LeakCanary 3
31mA Small Leak Can Sink A Great Ship
39mLeakCanary 2: Leaner, Better, Faster, Kotliner!
35mA small leak can sink a great ship
37mLeakCanary, then what? Nuking Nasty Memory Leaks
49mPokeLeaks: Gotta Catch 'em All
33mNuking Nasty Memory Leaks
25mMemory leaks on Android: lessons learned and methodology
