Diagnosing File Descriptor Exhaustion: EMFILE and ENFILE on Unix
A diagnostic guide for Unix EMFILE and ENFILE errors: how to tell per-process exhaustion from system-wide limits, inspect open descriptors, and apply targeted fixes.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
A diagnostic guide for Unix EMFILE and ENFILE errors: how to tell per-process exhaustion from system-wide limits, inspect open descriptors, and apply targeted fixes.
Create a systemd drop-in override with LimitNOFILE=65535, reload the manager, and restart the unit to raise the soft and hard RLIMIT_NOFILE for a service process.
Unix fork-exec preserves file descriptors by design, which can lead to security leaks. Learn how to use FD_CLOEXEC and strace to manage descriptor inheritance and prevent resource leakage.
File descriptors are the kernel’s integer handles for open resources. This post explains how they work, why close-on-exec prevents leaks, how to inspect them via /proc, and how to pass them between processes.
Goal: Understand descriptor reuse in Bash 5.1 process substitution The objective is to determine whether file descriptors allocated for process substitution are reused immediately after the substitution completes or only after the script terminates. This impacts long‑running scripts that rely heavily on process substitution, as unreused descriptors can exhau
Process Substitution Resource Management Bash utilizes process substitution <(command) and >(command) to map command output or input to a temporary file path, typically implemented via named pipes or /dev/fd entries. This mechanism allows utilities that require file arguments to interact with subshell streams. In long-running scripts or loops that freq
Context Vulkan allows importing external memory and semaphores via OS file descriptors through VK_EXT_external_memory_fd and VK_EXT_external_semaphore_fd . The specification states that behavior is implementation-defined when an imported handle becomes invalid after the application closes it or the OS revokes it. Constraint Applications must maintain valid d