permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.23k stars 1.44k forks source link

Gradle‘s daemon leak #664

Closed fanmingyi closed 3 years ago

fanmingyi commented 4 years ago

https://github.com/gradle/gradle/issues/12571

Similar problems:https://github.com/google/dagger/issues/1645

hotchemi commented 4 years ago

thx, do you have more insights? checked dagger's PR but I'm not super familiar around there.. 🤔 @fanmingyi

mannodermaus commented 4 years ago

From what I can gather by looking at the referenced issues, it seems like there is a memory leak within kapt when certain static caches or utilities are being used. In our case, the culprit seems to be this guy.

Screen Shot 2020-03-25 at 10 04 11

ELEMENT_UTILS is only used by a singular helper function. Maybe it's possible to rid ourselves of that static reference, which should in turn allow for proper GC. FWIW, we also have a static TYPE_UTILS, but I cannot see if that contributes to the leak as well.

bopbi commented 4 years ago

this issue is solved by update the gradle to 4.0.0 and the kotlin version

classpath 'com.android.tools.build:gradle:4.0.0'

hotchemi commented 3 years ago

ref: https://github.com/permissions-dispatcher/PermissionsDispatcher/pull/743 let me close the issue.