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

Paul Fisher pfisher@REDACTED
Tue Mar 17 13:31:38 CET 2009

Scott Lystig Fritchie wrote:
> Paul Fisher <pfisher@REDACTED> wrote:
> pf> My question: Is there any way to identify the "leaked" binaries?  If
> pf> I could look at a few, it would probably be enough to figure out the
> pf> culprit immediately.
> Not that I'm aware of.  However, I can suggest at least one place to
> start looking.  (I've been bitten by this, very unpleasant, yes.)
> If I'm not wildly mistaken (and I could be, I really should be asleep
> right now), then doing this a few thousand times will "leak" a lot of
> memory, apparently in binaries.
>     BigBin = list_to_binary(lists:duplicate(10*1024*1024, $x)),
>     <<_:8777666/binary, Desired:90/binary, _/binary>> = BigBin,
>     ets:insert(SomeTable, {SomeKey, ..., Desired, ...}),

Thank you for this suggestion.  I will see if this is the cause of my 
issue and report back.


More information about the erlang-questions mailing list