[erlang-questions] Erlang OTP 17.3 memory fragment problem (maybe)

Lukas Larsson <>
Mon Apr 13 10:59:18 CEST 2015


On Mon, Apr 13, 2015 at 10:43 AM, Daniel <> wrote:

>
> > On Apr 13, 2015, at 3:28 PM, Lukas Larsson <> wrote:
> >
> > Hello Daniel,
> >
> > On Mon, Apr 13, 2015 at 3:13 AM, Daniel <liudanking@
> >
> > So my question is:
> > Does it means that  I meat a ‘classic' memory fragmentation problem? If
> YES, how can I free the fragment memory to OS?Because my ejabberd have been
> killed by Linux OOM for several times. If NO, what cause the memory
> increase all the time?
> >
> > Would you mind checking how much of the binary_alloc memory is part of
> the mbc pool? ("erlang:system_info({allocator,binary_alloc}).", look for
> mbcs_pool). If it is very large you may have hit the bug described in
> OTP-12323, which has been fixed in Erlang/OTP 17.4. The scenario you are
> describing where the memory utilization constantly decreases sound very
> similar to what the bug fixed. If you don't want to upgrade to 17.4, you
> can also disable the pool in 17.3.
> >
> > Lukas
>
> Hi, Dear Lukas and list,
>
> Currently, linux *top* shows that beam.smp reserves 6.5GB memory ,
> recon_alloc:memory(allocated) outputs 6.5GB and recon_alloc:memory(usage)
> outputs 0.0969.
>
> Bellow is my binary_alloc memory of mbcs_pool:
>
> <<< -- cut -- >>>
>             {mbcs_pool,[{blocks,52044},
>                         {blocks_size,22538272},
>                         {carriers,115},
>                         {carriers_size,792723456}]},
> <<< -- cut -- >>>
>             {mbcs_pool,[{blocks,139776},
>                         {blocks_size,35429768},
>                         {carriers,752},
>                         {carriers_size,5443158016}]},

<<< -- cut -- >>>
> mbcs_pool cost (5443158016 + 792723456) bytes (5.8GB) memory.


>From this data I'm pretty sure that you are hitting the bug I mentioned. So
either upgrade to 17.4 or disable the pool (+Muacul 0) and your issue
should go away. For a detailed description of the problem see this:
https://github.com/erlang/otp/blob/master/erts/emulator/internal_doc/CarrierMigration.md#searching-the-pool
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150413/59aa3d54/attachment.html>


More information about the erlang-questions mailing list