{
  "id": "docker/container-oom-killed-memory-limit",
  "signature": "Container exited with code 137 (OOMKilled) - memory limit too low",
  "signature_zh": "容器退出代码137（OOMKilled）- 内存限制过低",
  "regex": "Container exited with code 137.*OOMKilled|memory limit too low",
  "domain": "docker",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Container exceeded its memory limit and was killed by the kernel OOM killer, typically due to insufficient --memory or -m setting.",
  "root_cause_type": "generic",
  "root_cause_zh": "容器超出了其内存限制，被内核OOM杀手终止，通常是由于--memory或-m设置不足。",
  "versions": [
    {
      "version": "Docker 24.0.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Docker 25.0.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "containerd 1.7.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Rebuilding the image with more layers doesn't change runtime memory limits; the limit is set at container start.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding swap space may delay the OOM but doesn't fix the underlying memory exhaustion; the container may still be killed or become unstable.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting the container without changing memory limits just repeats the same crash.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the memory limit when running the container: docker run -m 512m --memory-reservation 256m my_image",
      "success_rate": 0.85,
      "how": "Increase the memory limit when running the container: docker run -m 512m --memory-reservation 256m my_image",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use docker stats to monitor actual usage and set limit 20% higher: docker stats <container_name>",
      "success_rate": 0.8,
      "how": "Use docker stats to monitor actual usage and set limit 20% higher: docker stats <container_name>",
      "condition": "",
      "sources": []
    },
    {
      "action": "For Docker Compose, add mem_limit in docker-compose.yml: services: app: mem_limit: 512m",
      "success_rate": 0.85,
      "how": "For Docker Compose, add mem_limit in docker-compose.yml: services: app: mem_limit: 512m",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "增加内存限制：docker run -m 512m --memory-reservation 256m my_image",
    "使用docker stats监控实际使用量并设置高20%的限制：docker stats <container_name>",
    "在docker-compose.yml中添加mem_limit：services: app: mem_limit: 512m"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.docker.com/config/containers/resource_constraints/#memory",
  "official_doc_section": null,
  "error_code": "137",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}