{
  "id": "java/socketexception-too-many-open-files",
  "signature": "java.net.SocketException: Too many open files",
  "signature_zh": "java.net.SocketException：打开的文件过多",
  "regex": "java\\.net\\.SocketException: Too many open files",
  "domain": "java",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The JVM process has exhausted the file descriptor limit set by the operating system, typically due to unclosed sockets, file streams, or other I/O resources in the application.",
  "root_cause_type": "generic",
  "root_cause_zh": "JVM 进程已耗尽操作系统设置的文件描述符限制，通常由应用程序中未关闭的套接字、文件流或其他 I/O 资源引起。",
  "versions": [
    {
      "version": "Java 8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Linux kernel 5.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing the file descriptor limit on the OS without fixing the leak only delays the crash; the leak continues.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting the application temporarily frees descriptors but does not fix the root cause of resource leaks.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding more memory does not affect file descriptor limits; the issue is about OS limits, not heap.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use try-with-resources to ensure all Closeable resources (sockets, streams) are automatically closed. Review code for missing close() calls in finally blocks or using try-with-resources.",
      "success_rate": 0.9,
      "how": "Use try-with-resources to ensure all Closeable resources (sockets, streams) are automatically closed. Review code for missing close() calls in finally blocks or using try-with-resources.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Monitor the open file count using lsof on Linux to identify which resources are leaking. Use that information to fix the specific leak.",
      "success_rate": 0.85,
      "how": "Monitor the open file count using lsof on Linux to identify which resources are leaking. Use that information to fix the specific leak.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Temporarily increase the file descriptor limit for the JVM process using ulimit or systemd configuration, combined with a fix for the leak.",
      "success_rate": 0.75,
      "how": "Temporarily increase the file descriptor limit for the JVM process using ulimit or systemd configuration, combined with a fix for the leak.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use try-with-resources to ensure all Closeable resources (sockets, streams) are automatically closed. Review code for missing close() calls in finally blocks or using try-with-resources.",
    "Monitor the open file count using lsof on Linux to identify which resources are leaking. Use that information to fix the specific leak.",
    "Temporarily increase the file descriptor limit for the JVM process using ulimit or systemd configuration, combined with a fix for the leak."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/SocketException.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}