{
  "id": "cicd/gradle-daemon-out-of-memory",
  "signature": "org.gradle.launcher.daemon.server.DaemonExpirationPeriodicCheck: Daemon will be stopped at the end of the build after running out of JVM memory",
  "signature_zh": "org.gradle.launcher.daemon.server.DaemonExpirationPeriodicCheck：守护进程将在构建结束时因 JVM 内存不足而停止",
  "regex": "Daemon will be stopped.*running out of JVM memory",
  "domain": "cicd",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Gradle daemon exceeded its allocated JVM heap memory, causing the daemon to expire and potentially fail the build due to OutOfMemoryError or GC overhead limit.",
  "root_cause_type": "generic",
  "root_cause_zh": "Gradle 守护进程超出了分配的 JVM 堆内存，导致守护进程过期，并可能因 OutOfMemoryError 或 GC 开销限制而导致构建失败。",
  "versions": [
    {
      "version": "Gradle 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "JDK 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Gradle 7.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restarting the daemon without increasing memory will cause the same failure on the next build.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Setting -Xmx too high on a CI runner with limited RAM can cause the OS to OOM-kill the process.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the Gradle daemon heap in gradle.properties: org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m. Adjust values based on runner memory (e.g., 4GB runner: -Xmx3072m).",
      "success_rate": 0.9,
      "how": "Increase the Gradle daemon heap in gradle.properties: org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m. Adjust values based on runner memory (e.g., 4GB runner: -Xmx3072m).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable the daemon for memory-constrained CI by passing --no-daemon to Gradle, but this increases build time.",
      "success_rate": 0.75,
      "how": "Disable the daemon for memory-constrained CI by passing --no-daemon to Gradle, but this increases build time.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the Gradle daemon heap in gradle.properties: org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m. Adjust values based on runner memory (e.g., 4GB runner: -Xmx3072m).",
    "Disable the daemon for memory-constrained CI by passing --no-daemon to Gradle, but this increases build time."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.gradle.org/current/userguide/performance.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.85,
  "resolvable": "partial",
  "first_seen": "2023-07-08",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}