gpt4 book ai didi

java - 递归和 ram 洪水 : Starting a Gradle Daemon, 1 忙 6 停止 守护进程无法重用,使用 --status 了解详情

转载 作者:行者123 更新时间:2023-12-04 23:42:36 33 4
gpt4 key购买 nike

我正在使用这个插件 https://github.com/mozilla/rust-android-gradle ,这需要我添加

tasks.whenTaskAdded { task ->
if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) {
task.dependsOn 'cargoBuild'
}
}
到我的颤振项目的构建。 Gradle,当我做`flutter build ask时,我会得到类似的东西
Starting a Gradle Daemon, 18 busy Daemons could not be reused, use --status for details
Starting a Gradle Daemon, 19 busy Daemons could not be reused, use --status for details
...
然后它继续启动一个新的,直到我的 RAM 泛滥并且计算机崩溃。如果我对该代码发表评论,它就会构建。
有没有办法调试更多,看看发生了什么?查看系统监视器,它启动了许多 java Gradle 守护进程
这是 ./gradlew --info --stack trace --debug assembleDebug 输出的一部分
2022-04-24T17:14:45.981+0000 [QUIET] [system.out] > Configure project :
2022-04-24T17:14:45.981+0000 [QUIET] [system.out] Starting a Gradle Daemon, 2 busy and 23 stopped Daemons could not be reused, use --status for details
2022-04-24T17:14:51.958+0000 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager]
2022-04-24T17:14:51.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-04-24T17:14:51.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-04-24T17:14:51.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-04-24T17:14:51.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-04-24T17:14:51.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-04-24T17:14:51.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-04-24T17:14:46.015+0000 [LIFECYCLE] [org.gradle.internal.logging.progress.ProgressLoggerFactory]
2022-04-24T17:14:46.015+0000 [LIFECYCLE] [org.gradle.internal.logging.progress.ProgressLoggerFactory] > Configure project :
2022-04-24T17:14:54.279+0000 [QUIET] [system.out]
2022-04-24T17:14:54.279+0000 [QUIET] [system.out] > Configure project :
2022-04-24T17:14:54.279+0000 [QUIET] [system.out] Starting a Gradle Daemon, 3 busy and 23 stopped Daemons could not be reused, use --status for details
2022-04-24T17:15:01.958+0000 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager]
2022-04-24T17:15:01.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-04-24T17:15:01.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-04-24T17:15:01.958+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-04-24T17:15:01.959+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-04-24T17:15:01.959+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-04-24T17:15:01.959+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-04-24T17:14:54.315+0000 [LIFECYCLE] [org.gradle.internal.logging.progress.ProgressLoggerFactory]
2022-04-24T17:14:54.315+0000 [LIFECYCLE] [org.gradle.internal.logging.progress.ProgressLoggerFactory] > Configure project :
2022-04-24T17:15:02.379+0000 [QUIET] [system.out]
2022-04-24T17:15:02.379+0000 [QUIET] [system.out] > Configure project :
2022-04-24T17:15:02.379+0000 [QUIET] [system.out] Starting a Gradle Daemon, 4 busy and 23 stopped Daemons could not be reused, use --status for details
2022-04-24T17:15:10.279+0000 [QUIET] [system.out]
2022-04-24T17:15:10.279+0000 [QUIET] [system.out] > Configure project :
2022-04-24T17:15:10.279+0000 [QUIET] [system.out] Starting a Gradle Daemon, 5 busy and 23 stopped Daemons could not be reused, use --status for details
我的 build.gradle :
buildscript {
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.mozilla.rust-android-gradle:plugin:0.9.2'
}
毕业版本:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
更新:
 ./gradlew --status
PID STATUS INFO
671 IDLE 7.4.2
1026 IDLE 7.4.2
1320 IDLE 7.4.2
2128 IDLE 7.4.2
2470 IDLE 7.4.2
2760 IDLE 7.4.2
3035 IDLE 7.4.2

Only Daemons for the current Gradle version are displayed. See https://docs.gradle.org/7.4.2/userguide/gradle_daemon.html#sec:status
更新:
java --version
openjdk 11.0.14.1 2022-02-08
OpenJDK Runtime Environment (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
更新:
flutter --version
Flutter 2.10.5 • channel stable •
https://github.com/flutter/flutter.git
Framework • revision 5464c5bac7 (10 days ago) •
2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2
更新:
./gradlew --status
PID STATUS INFO
7625 IDLE 7.4.2
694 STOPPED (after the daemon registry became unreadable)
977 STOPPED (after the daemon was no longer found in the daemon registry)
6270 STOPPED (other compatible daemons were started after being idle for 0 minutes and not recently used)
5976 STOPPED (other compatible daemons were started after being idle for 0 minutes and not recently used)
5689 STOPPED (other compatible daemons were started after being idle for 0 minutes and not recently used)
6548 STOPPED (other compatible daemons were started after being idle for 0 minutes and not recently used)

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

最佳答案

假设这不是本地防火墙问题。
文件 $GRADLE_USER_HOME/gradle.properties定义行为。
可以阻止它重新启动守护程序(原因可能是插件而不是守护程序):

org.gradle.daemon.performance.enable-monitoring=false
或者可以完全禁用守护进程:
org.gradle.daemon=false

使用开关 --no-daemon 更好地首次运行,如 manual建议:

If it is suspected that the Daemon process has become unstable, it can simply be killed. Recall that the --no-daemon switch can be specified for a build to prevent use of the Daemon. This can be useful to diagnose whether or not the Daemon is actually the culprit of a problem.

关于java - 递归和 ram 洪水 : Starting a Gradle Daemon, 1 忙 6 停止 守护进程无法重用,使用 --status 了解详情,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71994409/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com