为什么Gradle构建的Kotlin源代码暂停约3秒“强制System.gc()”? [英] Why is Gradle build of Kotlin source code pausing for ~3 secs "forcing System.gc()"?
问题描述
[LIFECYCLE] $ b每个构建需要额外的3-4秒,在日志输出打印以下内容后立即暂停。 $ b [org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices]强制
System.gc()
为什么是它迫使这个?我如何避免这种情况,并加快我的构建?
我研究过这个,这是Gradle的调试级别日志记录已启用(例如 gradle --debug assemble
)。
$ b 运行Gradle而不启用调试日志记录(例如,
gradle --info assemble
)这不应该再发生。 Every build takes an extra 3-4 seconds, pausing immediately after the log output prints the following.
[LIFECYCLE] [org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices] Forcing System.gc()
Why is it "forcing" this? How do I avoid this and speed up my build?
I've looked into this, and this is a consequence of having Gradle's debug-level logging enabled (eg. gradle --debug assemble
).
Run Gradle without debug logging enabled (eg. gradle --info assemble
) and this should not occur anymore.
这篇关于为什么Gradle构建的Kotlin源代码暂停约3秒“强制System.gc()”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!