[erlang-questions] How to examine binaries identified by erlang:memory/2?

Paul Fisher pfisher@REDACTED
Sat Mar 14 14:42:05 CET 2009


I'm trying to track down what appears to be a memory leak in our nodes, 
which appears to be concentrated in binaries:

An earlier reading:

 > [garbage_collect(P) || P <- processes()]. 
                                                > 
{calendar:local_time(),erlang:memory([processes,binary,ets])}. 
                                             {{{2009,3,13},{17,19,45}}, 
 
[{processes,5351952},{binary,1058187944},{ets,49157456}]}

then 3.5+ hours later:

 > [garbage_collect(P) || P <- processes()]. 
                                                > 
{calendar:local_time(),erlang:memory([processes,binary,ets])}. 
                                             {{{2009,3,13},{20,52,53}}, 
 
[{processes,1524704},{binary,1876295920},{ets,4634816}]} 


with the 'binary' number steadily increasing in between.

Examining the memory associated with processes does not show anything 
near this amount of memory consumption, so it appears that we are 
keeping references to binaries from our linked-in drivers when we do not 
intend to.

My question:  Is there any way to identify the "leaked" binaries?  If I 
could look at a few, it would probably be enough to figure out the 
culprit immediately.


thanks,

--
paul



More information about the erlang-questions mailing list