启动Gradle守护程序,1个忙碌和6个停止的守护进程无法重用,请使用--status获取详细信息

问题描述 投票:16回答:1

当我运行gradle clean命令时,我收到以下消息

启动Gradle守护程序,1个忙碌和6个停止的守护进程无法重用,请使用--status获取详细信息

为了调查,我运行以下命令。

$ 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

所以,我脑子里出现了一些问题。

  1. 如何停止现有守护进程?
  2. 如何杀死守护进程?
gradle build android-gradle build.gradle
1个回答
15
投票

停止现有的守护程序:

如果您想出于任何原因明确停止运行Daemon进程,只需使用命令gradle --stop

gradle --stop不会阻止使用不同版本的Gradle运行守护进程。

如何在我的机器上杀死所有守护进程?

Gradle将杀死任何闲置3小时或更长时间的守护进程,因此您不必担心手动清理它们。

资源链接:Gradle Daemon Issue Details

所以命令和输出如下:

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

停止后台驻留程序后,状态将如下所示:

$ 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)

如果你坚持使用gradle构建运行,你可以通过这篇文章:Stuck with Gradle Build Running

© www.soinside.com 2019 - 2024. All rights reserved.