[erlang-questions] Huge binary usage

Robert Virding rvirding@REDACTED
Sat Oct 10 17:12:45 CEST 2009


When a binary is no longer used then that space will be reclaimed. The
problem is that since the binary is not local to a process it is more
difficult to find out and be sure of when it is no longer in use. This means
that the space may not be freed immediately for reuse and in more
pathological cases where large binaries are allocated extremely quickly you
may run out of space.

Robert

2009/10/10 Yogish Baliga <yogishb@REDACTED>

> If binary is not used, will that space is reused? Is it possible that the
> resident memory will grow to a point where VM will crash because of
> out-of-memory error?
>
> -- baliga
>
> ------------------------------
> *From:* Robert Virding <rvirding@REDACTED>
> *To:* Yogish Baliga <yogishb@REDACTED>
> *Cc:* Erlang Questions <erlang-questions@REDACTED>
> *Sent:* Thu, October 8, 2009 4:36:49 PM
> *Subject:* Re: [erlang-questions] Huge binary usage
>
> Large binaries are kept in the normal process heaps but outside of them.
> This means that they are not collected in the same way as normal data and
> can hang around for a longer time, though they will be collected.
>
> Robert
>
> 2009/10/9 Yogish Baliga <yogishb@REDACTED>
>
> > I have a erlang process which is running at 376MB Resident memory.
> > erlang:memory() shows the following output.
> >
> > [{total,265245056},
> >  {processes,56800140},
> >  {processes_used,56777884},
> >  {system,208444916},
> >  {atom,662173},
> >  {atom_used,636586},
> >  {binary,178220728},
> >  {code,4720224},
> >  {ets,21754908}]
> >
> > Seems like most of the memory is used  by "binary".
> >
> > Along with this, I did a sum of total memory used by all the processes
> > running on the system. It comes to around 53MB (which is same as what is
> > reported in processes_used).
> >
> > Question is how can I find what process(es) allocated the binaries and
> why
> > they are not released?
> >
> > Thanx,
> > -- baliga
> >
> > "Point of view is worth 80 IQ points" --Alan Kay
> >
> > http://dudefrommangalore.blogspot.com/
>


More information about the erlang-questions mailing list