5 ms·
I would like to second this. In Golang if you iterate over a thousand files and defer File.close() your OS will run out of file descriptors
by bashkiddie 8mo ago
I would like to second this.
In Golang if you iterate over a thousand files and
defer File.close()
your OS will run out of file descriptors
- Joker_vD 8mo agoWell, unless you're on Windows :D Even on Windows XP Home Edition I could open a million file handles with no problems. Seriously, why is default ulimit on file descriptors on Linux measly 1024?
- nasretdinov 8mo agoSome system calls like select() will not work if there are more than 1024 FDs open (https://man7.org/linux/man-pages/man2/select.2.html https://man7.org/linux/man-pages/man2/select.2.html), so it probably (?) makes sense to default to it. Although I don't really think that in 2k26 it makes sense to have such a low limit on desktops, that is true.
- remexre 8mo agohttps://0pointer.net/blog/file-descriptor-limits.html https://0pointer.net/blog/file-descriptor-limits.html