What is the significance of "file descriptor leaks" in long-running processes, and how might "lsof" help diagnose them?
Correct! Well done.
Incorrect.
The correct answer is A) A file descriptor leak happens when a process repeatedly opens files or sockets without closing them, exhausting the descriptor limit and causing "too many open files" errors; "lsof -p <pid>" lists open files, helping reveal the leak's source
Correct Answer
A file descriptor leak happens when a process repeatedly opens files or sockets without closing them, exhausting the descriptor limit and causing "too many open files" errors; "lsof -p <pid>" lists open files, helping reveal the leak's source
Diagnosing fd leaks often involves periodically running "lsof -p <pid> | wc -l" to track the count over time, or examining "/proc/<pid>/fd/" to see which specific files or sockets are accumulating, pointing to code paths that fail to close resources.