Memory leaks in AOSP system software—whether in privileged apps like Bluetooth or services like SystemUI—can silently degrade device performance and eventually trigger OOM crashes or ANRs. Traditional debugging tools struggle to catch these subtle, long-lived leaks. In this article, I’ll show you how to instrument LeakCanary into AOSP system components—even services not designed for app-level inspection—and use it to detect memory leaks in system software like Bluetooth.apk, Settings, or even your own custom privileged services.

Memory leaks in AOSP system software—whether in privileged apps like Bluetooth or services like SystemUI—can silently degrade device performance and eventually trigger OOM crashes or ANRs. Traditional debugging tools struggle to catch these subtle, long-lived leaks.
In this article, I’ll show you how to instrument LeakCanary into AOSP system components—even services not designed for app-level inspection—and use it to detect memory leaks in system software like Bluetooth.apk, Settings, or even your own custom privileged services.