How to force Intellij IDEA to use only one gradle daemon?

I know this might look like a duplicate. How do I disable the Gradle daemon in IntelliJ Idea? but I don’t want to completely disable the Gradle daemon. I just want to use only one demon, not many of them.

The problem is that for some Gradle tasks to succeed, I have to provide about 2 GB of RAM for gradle. And my system had only 8 GB of memory.

The problem is that when I perform certain actions (I think it is "update Gradle projects", there are 2 of them) - I get 2 or more Gradle daemons. Each consumes 2 GB of memory.

Is it possible to use only one daemon or in some way automatically stop these additional daemons?

+4
source share
1 answer

You can stop all currently running daemons with gradlew --stop. New deamon are created only when necessary. If e. d. a different version of Java is used or different daemon arguments are needed, etc. Perhaps you can look at Sysinternals ProcessExplorer and compare two processes to find where they differ, to find the reason why two are created.

+1
source

All Articles