9

I'm using gradle and intellij to build my android project. I've noticed that after one minute the daemon process shut down and I can see in the daemon-11188.out.log that the idle timeout is set to 60000 (idleTimeout=60000).

Here is the line from the log:

15:51:46.747 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=1be5dcbe-d445-4cf6-87d8-03e443368b0c,javaHome=C:\Program Files\Java\jdk1.7.0_45,daemonRegistryDir=C:\Users\ry_000\.gradle\daemon,pid=11624,idleTimeout=60000,daemonOpts=-Dfile.encoding=windows-1252]

I tried everything but couldn't find a way to override this setting.

Any help would be greatly appreciated, thank you.

Will
  • 24,082
  • 14
  • 97
  • 108
Rotem
  • 2,306
  • 3
  • 26
  • 44
  • For those finding this in the future, there is a ticket about this here: https://youtrack.jetbrains.com/issue/IDEA-148240 – Edu Garcia Jan 17 '17 at 20:46

3 Answers3

12

I had the same problem and looked through sources and found ExternalSystemExecutionSettings.java
So, to increase gradle daemon timeout in IntelliJ Idea add this line to idea.properties file:

external.system.remote.process.idle.ttl.ms=6000000
kalikin
  • 121
  • 2
  • 3
  • 2
    The location of the `idea.properties` file is described at https://www.jetbrains.com/help/idea/2016.3/file-idea-properties.html. – mhsmith Mar 31 '17 at 16:20
6

Well, it turned out that IntelliJ uses the gradle api to set 1 minute for the idle timeout. I fixed that by compiling the gradle launcher with constant value of 3 hours. You can get the file here: gradle-launcher-1.9.jar

Rotem
  • 2,306
  • 3
  • 26
  • 44
  • 1
    Thanks! For those who were wondering what exactly should one do with this jar, the answer is the following: in Android Studio go to File->Settings->Gradle and check what the "Service directory path" points to. Go into this folder and replace the default gradle-launcher-1.11.jar in the wrapper\dists\gradle-1.11-all\%_some_hash_%\gradle-1.11\lib\ folder with the jar Rotem kindly provided. NOTE: This is applicable if you are using the recommended wrapper option, otherwise you probably already know where your gradle launcher is located anyhow. – Alex Fedulov May 18 '14 at 14:09
0

It's configureable by gradle.properties.

org.gradle.daemon=(true,false)
org.gradle.daemon.idletimeout=(# of idle millis)
周建伟
  • 1
  • 1