This entry has been deprecated and merged into CWE-774 (Allocation of Resources Without Limits or Throttling). The content describing uncontrolled file descriptor consumption is now fully covered under that more comprehensive weakness.
File descriptor exhaustion occurs when a program opens files, sockets, or pipes without properly closing them or enforcing limits. This can happen due to infinite loops, failure to handle errors, or simply neglecting to release resources after use. When the system runs out of descriptors, the application and potentially other processes will fail to open new files or network connections, leading to crashes or denial-of-service. Developers should treat file descriptors as a finite system resource that requires active management. Implement robust error handling to catch and close descriptors on failures, use tools like `ulimit` to set process boundaries, and consider using resource pools or throttling mechanisms. The core issue is now addressed under CWE-774, which covers the broader pattern of unlimited resource allocation.