Problem with leaking file descriptors

Serge Aleynikov <>
Fri May 13 15:48:24 CEST 2005


I am not sure whether such a file descriptor table exists inside otp, 
but you can use the "lsof" os tool (on Linux: /usr/sbin/lsof) to show 
all file descriptors (of all types: file/socket/pipe/etc) open by the 
beam, and then try to deduce which files are left open from your 
application running by the run-time, and which ones are not.

Serge

Thomas Johnsson XA (LN/EAB) wrote:

> Hi,
> we have a problem where the erlang process is slowly consuming all the available file
> descriptors (takes days). And there are many ways to open an fd: open file, tcp, dets/mnesia, open_port,... could of course try to trace relevant ops, like file:open, file:close, etc.
> Are there any other better ideas out there on how to tackle this problem?
> 
> Ideally, one could wish for a file descriptor table inside otp, keeping track of
> how/where fd's were opened...
> 
> Any hints / ideas on this would be much appreciated!
> 
> -- Thomas



More information about the erlang-questions mailing list