[erlang-questions] memory leak.

Mihai Balea mihai@REDACTED
Thu Apr 16 13:36:55 CEST 2009


On Apr 16, 2009, at 2:24 AM, Roman@REDACTED wrote:

> Hi dear Team,
>
> A problem appeared with the memory leak. Function "erlang:memory()"  
> shows
> that "total" parameter  grows constantly and fast, during the day it
> increases from 60 Mb till 510 Mb. "System" parameter also grows
> constantly, not as much fast, reaching 400 Mb.
> "process" parameter although does not reach 100 Mb. Top  FreeBSD  
> utility’s
> "size" parameter also increases from 70 Mb till 600 Mb.
> System crashes on "mem_error" of the module "zlib.erl" or on the error
> "system_limit" while creating new process
> {erlang,open_port,[{spawn,zlib_drv},[binary]]}. "yaws",  
> "error_logger" and
> some gen_server-s work on the computer. No database except "ets" is  
> used
> during the functioning, but the used memory doesn’t exceed 1 Mb.  
> Server
> receives messages each second.
> The memory releases after restarting erlang. Restarting individual
> gen_server-s gives nothing.
>
> What is the reason of appearing memory leak problem?

Chances are, a programming error on your part.

The fact that you're getting "system_limit" errors when creating new  
processes leads me to believe that you might not have a memory leak  
per se, but a process leak.  Meaning you are dynamically creating  
processes, but don't shut them down.

You can find the number of processes on your node using

length(processes()).

Try to see if this number increases constantly during operation.

Mihai


More information about the erlang-questions mailing list