[GRADLE-2357] Running gradle with --no-daemon still forks a daemon when org.gradle.jvmargs are specified Created: 15/Jun/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0
Fix Version/s: None

Type: Bug
Reporter: Jan Bols Assignee: Unassigned
Resolution: Won't Fix Votes: 19


 Description   

To avoid OOM exceptions we specify the following in our gradle.properties when running the daemon:
org.gradle.jvmargs=-XX:MaxPermSize=256m -Xms256m -Xmx512m

However when we don't want to run the daemon (f.e. because there's a plugin doing System.console stuff which doesn't work in daemon-style) we should specify --no-daemon or put or.gradle.daemon=false in our gradle.properties.

However when doing either of the above settings a daemon is still forked:

Note: in order to honour the org.gradle.jvmargs and/or org.gradle.java.home values specified for this build, it is necessary to fork a new JVM.
This forked JVM is effectively a single-use daemon process. In order to avoid the slowdown associated with this extra process, you might want to consider running Gradle with --daemon.

Basically there's no way to not run gradle as a daemon when there's a org.gradle.jvmargs specified. This is quite annoying.



 Comments   
Comment by Simon La Macchia [ 23/Jan/13 ]

This bug, combined with GRADLE-2193, is causing us all kinds of headaches..

Comment by Martin Kleppmann [ 26/Jun/14 ]

This forking is a problem for plugins that need to read from stdin, e.g. a password for publishing to a repository or a passphrase for decrypting a signing key. We shouldn't have to put passwords in plaintext files — asking for them interactively is much preferable. Here's an issue: https://github.com/bmuschko/gradle-nexus-plugin/issues/27

An alternative solution would be to attach the parent process' standard input to the forked process (with the daemon, that might be harder). Are there any plans to do that?

Comment by Michael Bailey [ 19/Mar/15 ]

Another work around is to not set "org.gradle.jvmargs" and instead set the GRADLE_OPTS env var to include you JVM params ( i.e. -XX:MaxPermSize=256m -Xms256m -Xmx512m )

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:19:42 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.