Fixed
Status Update
Comments
ky...@mapbox.com <ky...@mapbox.com> #2
The hellocar.zip report is still created on version 1.1.0-beta.1
sh...@google.com <sh...@google.com> #3
Thanks for reporting the issue. We will take a look
sh...@google.com <sh...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 184f18330759bbb16fc480dee3d34dc0259dd457
Author: Billy Lam <shiufai@google.com>
Date: Wed Jan 05 15:02:17 2022
Fixed a memory leak due to the ICarApp binder outliving its parent CarAppService
When the car host unbinds from an app, the ICarApp binder stays around until the
host reference to the binder also gets cleaned up. This often means that the CarAppService
is destroyed first but being held around by the binder being an inner class.
This change makes the binder a static inner class, and we explicitly remove its
reference to the outer CarAppService when the service is destroyed.
Bug: 203594731
Bug: 213378655
Test: Verified with the sample showcase app that a leak is no longer reported
Relnote: Fixed a memory leak in `CarAppService` when the car host unbinds.
Change-Id: I5c9caf05797ea257ef21cbd96dab5fdfbc85a70e
M car/app/app/src/test/java/androidx/car/app/CarAppServiceTest.java
M car/app/app/src/main/java/androidx/car/app/CarAppService.java
M car/app/app-samples/showcase/common/build.gradle
https://android-review.googlesource.com/1926808
Branch: androidx-main
commit 184f18330759bbb16fc480dee3d34dc0259dd457
Author: Billy Lam <shiufai@google.com>
Date: Wed Jan 05 15:02:17 2022
Fixed a memory leak due to the ICarApp binder outliving its parent CarAppService
When the car host unbinds from an app, the ICarApp binder stays around until the
host reference to the binder also gets cleaned up. This often means that the CarAppService
is destroyed first but being held around by the binder being an inner class.
This change makes the binder a static inner class, and we explicitly remove its
reference to the outer CarAppService when the service is destroyed.
Bug: 203594731
Bug: 213378655
Test: Verified with the sample showcase app that a leak is no longer reported
Relnote: Fixed a memory leak in `CarAppService` when the car host unbinds.
Change-Id: I5c9caf05797ea257ef21cbd96dab5fdfbc85a70e
M car/app/app/src/test/java/androidx/car/app/CarAppServiceTest.java
M car/app/app/src/main/java/androidx/car/app/CarAppService.java
M car/app/app-samples/showcase/common/build.gradle
sh...@google.com <sh...@google.com> #5
Thanks again for reporting the issue. The fix should be available in the next library release.
Description
Android Auto version reproduced on: 1.0.0
Copy paste from the leakcanary issue below
I was digging into a leak that I thought was our implementation. But found that a minimal project also receives leaks. It's attached. I'm sharing here because maybe the leakcanary folks recognize this error. I'll share a google issue tracker after posting.
Repro steps
LeakTrace information