Closed lucas34 closed 4 years ago
Hmm, my initial guess is that this is due to reading the KotlinClassMetadata for each module (required for the new Kotlin-specific features). I'll take a look at this and see if anything obvious shows up in profiling.
I manage to compile by using gradle plugin 3.6.0-beta1. Will continue testing with this one.
When switching to 3.6.0-beta1, does that fix just the OOM or does it also change the build speed as well?
With 3.6.0-beta1 the build speed is back to how to was with the old dagger version.
I still get Out of Memory Errors with dagger 2.25.2 and gradle plugin 3.6.0-beta02
I think that 3.6.0 helps (sometimes) just because in 3.6 were fixed a few regressions of 3.5 that cause higher memory usage, so most probably Dagger 2.25.2 has higher usage of memory, but it less visible on 3.6 which has lower usage of memory, but the problem still exists (as @chrisharris77 mentioned)
Thanks, we're looking into this. It is likely that the extra Kotlin metadata processing we need to do for the object class and qualifier on fields support is taking the extra memory.
R.java files (generated in 3.5) may cause very high memory usage. In 3.6 we generate R.jar so this should save quite a bit of memory in the javac compiler (which is used by KAPT).
Subscribing, just started using 2.25.2
Still have out of memory after updating to 2.25.3
I got 3gb leaked from kapt (kotlinCompiler daemon). From the tree view seems from dagger codegen requestKinds
Some people also got similar issue: https://youtrack.jetbrains.com/issue/KT-32962
Thanks for the heap dump. Looks like this is from a static cache in RequestKinds
causing a memory leak, which is probably made worse due to the persistent GradleDaemon. We should have a fix shortly, and we'll push out a new minor release.
2.25.4 resolves the out of memory issue in our case. We have 70k+ lines in the generated dagger component.
Thanks everyone. Will bump and will close this issue if we can confirm that the issue went away.
I checked my heap dump from 2.25.4 and the leak went away. Thanks for the fix !
Hi, I recently tried to update to dagger 2.25.2 from 2.24. I'm having OOM during kapt. I tried changing the configuration with way more memory and I notice that the annotation processing is around 2 to 3x slower compare to 2.24. The project is pretty huge, almost fully in kotlin and have hundreds of modules
EDIT: Having the issue with gradle plugin 3.5.1 but does not happen with 3.6.0-beta1