So you’ve created a socket server that opens sockets over TCP/IP. After running it for a few hours under heavy load the operating system kills your process with the message “Too many open files”. What happened? The problem On most POSIX operating systems, including Linux and Os X, each process is allocated a fixed table of file handles, or file descriptors. This is typically about 1024 handles. Wh
![Fixing File Descriptor Leaks in Long-Lived Servers – Rafael Baptista](https://cdn-ak-scissors.b.st-hatena.com/image/square/8e76afafcadece433ad81ef59858676da9faed07/height=288;version=1;width=512/https%3A%2F%2Foroboro.com%2Fwp-content%2Fuploads%2F2013%2F05%2Finstacod.es2_.png)