Extending the gradle daemon idle timeout

(Rotem Yakir) #1

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.

(Attila Kelemen) #2

It is most likely, that Idea itself sets the timeout. You have to ask them if it is configurable in Idea.

(Rotem Yakir) #3

Well I have an option in intellij to pass gradle options and I pass this:


is that seem right to you?

(Attila Kelemen) #4

There is an internal API in Gradle to set the timeout and I guess they are using that. So, it is possible that you can only override those settings if they provided an explicit way for it. Though, I’m not sure, I have never tried.

(Rotem Yakir) #5

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: https://www.dropbox.com/s/yvtm5kfsjibq8q8/gradle-launcher-1.9.jar