question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide more insights about "Multiple Gradle daemons were used".

See original GitHub issue

Sometimes 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:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ZacSweerscommented, May 31, 2021

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.disabled system property to true and have been fine since.

0reactions
kenyeecommented, Sep 8, 2022

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found