43

When I was running the gradle clean command, I got the following message

Starting a Gradle Daemon, 1 busy and 6 stopped Daemons could not be reused, use --status for details

For the investigation, I run the following command.

$ gradle --status
   PID STATUS   INFO
 11506 BUSY     4.3.1
  8027 STOPPED  (stop command received)
  9347 STOPPED  (stop command received)
 11727 STOPPED  (by user or operating system)
  4786 STOPPED  (by user or operating system)
 14569 STOPPED  (by user or operating system)
 31237 STOPPED  (by user or operating system)

Only Daemons for the current Gradle version are displayed. See https://docs.gradle.org/4.3.1/userguide/gradle_daemon.html#sec:status

So, some questions have arisen in my mind.

  1. How can I stop an existing daemon?

  2. How to kill daemon process?

SkyWalker
  • 24,796
  • 7
  • 62
  • 118

5 Answers5

38

Stopping an existing Daemon:

If you want to explicitly stop running Daemon processes for any reason, just use the command gradle --stop.

Note: for your consideration the gradle --stop command won’t stop daemons running with a different version of Gradle.

How to kill all Daemon process on my machine?

Gradle will kill any Daemon that has been idle for 3 hours or more, so you don’t have to worry about cleaning them up manually.

Resource Link: Gradle Daemon Issue Details

So the command and output are given below:

$ gradle --stop
Stopping Daemon(s)
2 Daemons stopped

After stopping daemons, status will be look like below:

$ gradle --status
No Gradle daemons are running.
   PID STATUS   INFO
  8027 STOPPED  (stop command received)
  9347 STOPPED  (stop command received)
 12448 STOPPED  (stop command received)
 11506 STOPPED  (stop command received)
 11727 STOPPED  (by user or operating system)
  4786 STOPPED  (by user or operating system)
 14569 STOPPED  (by user or operating system)
 31237 STOPPED  (by user or operating system)

If you are stuck with gradle build running, you can to through this post: Stuck with Gradle Build Running

Manuel Jordan
  • 11,959
  • 15
  • 69
  • 111
SkyWalker
  • 24,796
  • 7
  • 62
  • 118
  • 4
    You haven't answered the implied question, which is how do you get rid of the STOPPED daemons sitting around on your machine. On my Mac machines I eventually wind up with hundreds of STOPPED daemons. Gradle needs a "--purge" command to get rid of these. – Stevey Oct 14 '20 at 19:48
12

I solve it with another method in other post. By removing folders like 4.4 4.6 5.4.1 5.5 in directory as below

/users/[username]/.gradle/daemon

java.lang.OutOfMemoryError: GC overhead limit exceeded

Kyo Kurosagi
  • 1,495
  • 13
  • 14
1

Just add two lines in your app -> Gradle Scripts -> gradle properties

org.gradle.daemon=true

org.gradle.parallel=true
HandyPawan
  • 638
  • 1
  • 7
  • 11
-2

Beleive it or not

  npm cache clean --force

solved this for me

-3
Aku mencoba cara ini .
1. dari App kamu => masuk folder android
2. .gradle folder hapus
3. gradle folder buka dan pilih file gradle-wrapper-properties dan isinya ganti dengan ini ==>
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Eldir
  • 1
  • 1
  • 1
  • 3
    Not everyone is multilingual. Please care to add more details in [English](https://meta.stackexchange.com/q/13676/397211) so that more people can benefit out of it. – Asif Kamran Malick Mar 08 '21 at 11:41