This talk will cover strategies for defending memory on Android devices. First, a little bit about what memory resources are available on a smartphone. Then, up a layer of abstraction where we can practically manipulate memory. We follow Android on its garbage collection route and through its lifecycle. Next, we observe a memory leak in the wild. We herald its presence with LeakCanary and see its manifestation on the memory profiler. Finally, we explore tactics to manage memory in asynchronous operations. For old time’s sake, we leak a context through an AsyncTask. We clean up after an RxJava observable. We figure out why LiveData would allow you to call addObserver() without subsequently removingObserver().
Attendees will come away armed against leaks with a better grasp on how Android and some of our favorite libraries deal with memory.