Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-2357

Running gradle with --no-daemon still forks a daemon when org.gradle.jvmargs are specified

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Won't Fix
    • Affects Version/s: 1.0
    • Fix Version/s: None

      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.

        Activity

        Hide
        slamacchia Simon La Macchia added a comment -

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

        Show
        slamacchia Simon La Macchia added a comment - This bug, combined with GRADLE-2193 , is causing us all kinds of headaches..
        Hide
        martinkl Martin Kleppmann added a comment -

        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?

        Show
        martinkl Martin Kleppmann added a comment - 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?
        Hide
        yogurtearl Michael Bailey added a comment -

        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 )

        Show
        yogurtearl Michael Bailey added a comment - 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 )
        Hide
        bmuschko Benjamin Muschko added a comment -

        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!

        Show
        bmuschko Benjamin Muschko added a comment - 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!
        Hide
        bmuschko Benjamin Muschko added a comment -

        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.

        Show
        bmuschko Benjamin Muschko added a comment - 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.

          People

          • Assignee:
            Unassigned
            Reporter:
            janbols Jan Bols
          • Votes:
            19 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development