I tried it and while it is a good approximation, it is not perfect. I think for FDs we need to get the exact value from the OS because it will be much easier to detect problems related to it. I guess that erlang:ports() also does not keep track of FDs opened by C-code (eg nifs). So I just go for the hack-ish solution here.