<https://kotlinlang.slack.com/archives/C19FD9681/p...
# gradle
d
https://kotlinlang.slack.com/archives/C19FD9681/p1542018400136700 Is there any plans to backport 1.0.x dsl to 4.x gradle? Android devs kinda stuck between unstable Android Studio 3.4 canary (gradle 5 rc not even supported yet) and 4.9 kotlin dsl. dsl 1.0rc in 4.10.x has memory leak issue (https://github.com/gradle/kotlin-dsl/pull/1188) i’m only one seeing this?
🙏 1
2
j
@dsvoronin I'd highly doubt that the Kotlin DSL will ever be back ported to the 4.0 API.
d
it is for 1.0-rc6 or so
4.10.2 has 1.0-rc6 bundled
j
Correct.
I've been using the Gradle Kotlin DSL since
0.5.1
. The
1.0-rc6
of the Kotlin DSL is pretty dang stable. You can use it in your builds at least without too much concern about them breaking too much when you update to 5.0.
d
but… i have memory leak issue with it it’s in first message in this thread
j
Ah. Yea. And you can't update to
5.0-rc-3
because of the android support?
d
it’s so bad, i have to manually kill kotlin compiler process every 2-3 builds
yep
gradle daemon has no control over kotlin daemon, so disabling gradle daemon doesn’t help much
j
@eskatos @bamboo Do either of you have a suggested workaround to this problem? You could consider running the Kotlin compiler in-process?
e
that leak was in the gradle build daemon, if you have memory issues with the kotlin compiler daemon then that’s something else
d
it maybe in gradle daemon we disabled it, it became better, but there is also a compiler daemon problem, i’d research it after got to fixed kotlin dsl version
its truly a gradle daemon ) it’s with org.gradle.daemon=false in ~/.gradle/gradle.properties
3 top java processes - gradle 418mb ram -> kotlin daemon
Timeout waiting for all daemons to stop. Waited 1 mins 40.632 secs.
e
that looks bad
to rule things out, one at a time, do you use the
kotlin-dsl
plugin?
d
yep, in buildSrc
there are multiple modules there, most of them uses kotlin-dsl plugin, but not root one
e
ok, that’s the guy that triggers the memory leak we fixed in 1.0
can you confirm only your gradle daemon is suffering from memory starvation? just wanna rule out any other unrelated problem with the kotlin compiler daemon
d
what do you mean? only mine? whole team daemons )
e
no I mean gradle build daemon vs. kotlin compiler daemon
d
it’s hard to say. right now only gradle daemon peaks and hangs. but i encounter situation with kotlin compiler daemon too
e
okay
d
i don’t have in-process mode enabled in properties (like an issue in gradle integration tests)
👍 1
e
could you try adding
kotlinDslPluginOptions.experimentalWarning.set(false)
to all your build scripts that apply the
kotlin-dsl
plugin?
it should short-circuit the leaky code path
d
just added based on your PR fix, i’ll try it now
🤞 1
🤞 but it looks better now, what instances should i look into for memory dump? i’ll double check it later
e
Project
instances would be a good indicator
d
Thanks for the workaround! For backporting stable version of dsl to 4.x . answer is no?
e
Not planned
d
i just don’t know if there any big anchors in 5.x api
ok; we’ll try to carry till android support 5.x gradle
another build log fast-failure custom check, now for “warning kotlindsl uses experimental blabla” 😛
after multiple success builds with daemon enabled (both from console and IDE)
e
what is this app? what are the two columns? hard to say anything without more context