Provide more insights about "Multiple Gradle daemons were used".
See original GitHub issueSometimes when I run benchmarks/profiling it fails with
* Stopping daemons
java.lang.RuntimeException: Multiple Gradle daemons were used.
at org.gradle.profiler.Main.checkPid(Main.java:461)
at org.gradle.profiler.Main.runGradleScenario(Main.java:188)
at org.gradle.profiler.Main.run(Main.java:80)
at org.gradle.profiler.Main.main(Main.java:27)
But nowhere in stdout/stderr or profile.log can I find logs that indicate when and why Gradle daemon was started.
What’s more weird is that I’m getting that in very isolated environment: a Docker container gets started for every profile/benchmark session.
(But I’ve also seen it in non-containerized runs).
Would be great if gradle-profiler could give more info about it, ideally it should be actionable 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The Gradle Daemon - Gradle User Manual
A daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user....
Read more >Gradle spawn multiple Java daemons instead of reusing ...
After working in the Android Studio for few hours, number of Java daemons get increased (screenshot attached - before spawning many more instances), ......
Read more >It is currently in use by another Gradle instance - Stack Overflow
Then run gradle as following to get better insight what is going on. gradle --debug --no-daemon. The debug log shows owner of the...
Read more >The Gradle build system- Tutorial - Vogella.com
Gradle is a general purpose build management system. Gradle supports the automatic download and configuration of dependencies or other libraries ...
Read more >Make your Gradle builds fast again! | by Łukasz Wasylkowski
Simply put, Gradle is written in Java, so it'll benefit from performance improvements in newer JVM implementations. While Android Studio now ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We just gave up on trying to work around this and believe that Gradle’s GC polling is currently flawed. We disable GC polling instead via setting the
org.gradle.daemon.gc.polling.disabledsystem property to true and have been fine since.I don’t see anything in the checkpid code that would be affected by that flag though: https://github.com/gradle/gradle-profiler/blob/df9ede45b5e4d21822b3bcbb38b58ef66d3deb05/src/main/java/org/gradle/profiler/GradleScenarioInvoker.java
Looks like a fairly simple pid comparison of gradle daemons…no way to opt out in that code…