{
  "id": "pytorch/dataloader-num-workers-memory-leak",
  "signature": "RuntimeError: DataLoader worker (pid 12345) received signal 9 (SIGKILL). Possible causes: out of memory or system limit reached.",
  "signature_zh": "RuntimeError: DataLoader 工作进程 (pid 12345) 收到信号 9 (SIGKILL)。可能原因：内存不足或达到系统限制。",
  "regex": "DataLoader worker \\(pid \\d+\\) received signal 9 \\(SIGKILL\\)",
  "domain": "pytorch",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Too many DataLoader workers with high memory usage per sample cause the system OOM killer to terminate workers, especially when using large datasets or high-resolution images.",
  "root_cause_type": "generic",
  "root_cause_zh": "DataLoader 工作进程数量过多且每个样本内存使用量高，导致系统 OOM killer 终止进程，尤其在使用大数据集或高分辨率图像时。",
  "versions": [
    {
      "version": "1.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing workers exacerbates memory pressure, causing more frequent OOM kills.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This doesn't reduce per-worker memory; it just changes how data is split.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce num_workers to a lower value, e.g., 2 or 4, or set to 0 for single-process loading to eliminate worker memory overhead.",
      "success_rate": 0.9,
      "how": "Reduce num_workers to a lower value, e.g., 2 or 4, or set to 0 for single-process loading to eliminate worker memory overhead.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use prefetch_factor to limit the number of batches prefetched per worker, reducing peak memory usage.",
      "success_rate": 0.75,
      "how": "Use prefetch_factor to limit the number of batches prefetched per worker, reducing peak memory usage.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Reduce num_workers to a lower value, e.g., 2 or 4, or set to 0 for single-process loading to eliminate worker memory overhead.",
    "Use prefetch_factor to limit the number of batches prefetched per worker, reducing peak memory usage."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pytorch.org/docs/stable/data.html#multi-process-data-loading",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}