Skip to content

Would like the ability to stop the gradle daemon from flutter tool #31089

@jamesderlin

Description

@jamesderlin

I regularly see gradle consuming nearly 700+ MB of RAM on my Linux system. I consider that to be a lot, especially when it's sitting there doing nothing.

The path to my gradle binary is convoluted (e.g. ~/.gradle/wrapper/dists/gradle-4.4-all/9br9xq1tocpiv8o6njlyu5op1/gradle-4.4/bin/gradle) and changes with gradle versions, so manually invoking gradle --stop is non-trivial.

Additionally, the flutter tool tries to abstract away build processes for Android (and iOS) apps, so many users might not even know what gradle is or why it's running. Since flutter run started the gradle daemon, it'd be nice if the flutter tool also provided some mechanism to stop it.

I mentioned this in chat a few months ago. @dnfield considered disabling the gradle daemon unless the user opts in. I suggested making flutter stop (possibly with a command-line option) stop the gradle daemon, but @Hixie didn't like that since it's not really what stop is meant for. He suggested adding a command-line option to flutter clean to do it.

Some other ideas:

  • Automatically stop gradle if flutter run hasn't been used in some time. (But this would require some other daemon. Ideally gradle would provide the ability to do this itself.)
  • Automatically stop gradle when there's no longer a connected device. (But even if there is a way to be notified of this, this probably also would need some other process.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityt: gradle"flutter build" and "flutter run" on Androidteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions