Linux system errors
Too Many Open Files
Reviewed for reference consistency: August 11, 2026
the process hit its per-process descriptor ceiling
What 24 Means
The 24 error on the Linux system errors indicates too many open files — the process hit its per-process descriptor ceiling. This typically occurs due to a file-descriptor leak: sockets or files opened in a loop and never closed.
Exit code 24 corresponds to EMFILE, 'Too many open files'. Every process owns a fixed-size table of descriptors, and EMFILE is the ceiling reached: open() and socket() fail not because resources are missing on disk or network, but because the process's own table has no free row left to record the new one.
How to fix 24
General informational guidance, not professional advice. Commands can affect your system or data — back up first and proceed at your own risk. FixerCode is an independent reference, not affiliated with any vendor mentioned.
Show the current ceiling
ulimit -n reports the per-process descriptor limit the shell will hand to programs it starts.
ulimit -nCount the shell's open descriptors
The count of entries in the per-process fd directory is the current usage; comparing it with the ceiling shows the remaining headroom.
ls /proc/self/fd | wc -lCount a running service's descriptors
Substituting the service's PID gives the same usage count for any live process under investigation.
lsof -p $(pidof your_process) | wc -l
Technical Background
Every process owns a fixed-size descriptor table; EMFILE is the ceiling, not a shortage. The disk has room, the network stack is fine — the refusal is pure bookkeeping: the table that would record the new file or socket has no row left. The per-process limit, visible through ulimit, is the number that was hit.
Leaks give the ceiling its drama. A server that forgets one socket per request runs cleanly through every functional test and fails on day three of production, when request number 1025 arrives. The delay between cause and symptom is why descriptor leaks are among the most commonly diagnosed resource bugs in long-running services.
The historical default of 1024 rows does not survive contact with modern workloads — build systems, container runtimes, and indexers all touch thousands of files. Raising the limit treats the symptom's timing; finding the unclosed descriptor treats the cause.
Common Causes
- A file-descriptor leak: sockets or files opened in a loop and never closed
- A limit configured too low for the workload (the historical 1024 default)
- A burst of concurrent connections or files legitimately exceeding the current ceiling
Typical Scenarios
- A long-running service leaking one socket per request and failing after crossing its limit days later
- A build tool or indexer with thousands of open files dying under the historical default limit
- A load test pushing concurrent connections past a service's configured ceiling
What to Know
Two numbers frame the diagnosis: the current usage (counted from the process's descriptor directory) and the ceiling itself. Usage growing monotonically under steady load is the leak's signature; usage pinned at a raised ceiling points at legitimate scale.
Frequently Asked Questions
Common questions about Linux 24 error
Count the entries in the process's fd directory — one line per open descriptor — and compare with the limit from ulimit -n. The gap between the two numbers is how close the process is running to the ceiling.
Usually not — the default limit is per process. The system-wide table has its own cap and its own errno, which is far rarer. Exit 24 almost always belongs to one process's behavior or its own limit.
One unclosed socket per request is invisible per-request. The table fills linearly, so a service under steady load crosses its ceiling only after enough requests accumulate — which is why EMFILE failures tend to appear mid-week rather than at startup.
Related Error Codes
Out of Memory (ENOMEM) — the kernel cannot allocate the requested amount of memory
No Space Left — the filesystem ran out of data blocks or of inodes
Bad File Descriptor — the descriptor number is not open in this process's table
Invalid Argument — a syscall received a malformed or self-contradictory parameter
Related Errors From Other Categories
Similar error codes documented across different platforms and systems
Git paused the merge because it cannot automatically resolve overlapping changes.
Git aborted the merge to protect uncommitted changes in your working directory.
Git prevented a branch switch because it would overwrite unsaved changes in your working directory.
Git aborted the merge because it would overwrite untracked files in your working directory.