[erlang-questions] Why am I seeing RefcBinary with length < 64?
Wed Dec 20 15:32:49 CET 2017
It is possible that these binaries comes as part of larger binaries (also
called sub binaries).
Some information are available at
Sub binaries only store reference to originating binary and length - it
also mean, that originating binary can not be freed.
You can use binary:copy/1 to convert sub binary to fresh new binary (witch
will be stored on heap in case of small binaries).
On Wed, Dec 20, 2017 at 3:24 PM, Roger Lipscombe <roger@REDACTED>
> Everything I've read on the subject of garbage collecting Erlang
> binaries says that binaries > 64 octets are stored off-heap.
> If I dump (using gdb and etp-offheapdump -- patched for 64-bits) the
> off-heap binaries for a given process, I get something like the
> All in all, there are about 19.5K of them for this particular process.
> But they're all 0xc, 0x10 or 0x18 bytes in length.
> Mathematically astute readers will note that all three of those
> numbers are less than 64.
> Why are these binaries being stored off-heap? Is it bad? How do I make
> it store them in the process heap?
> Background: the process in question is a custom supervisor; it stores
> its children in a list of records; it starts processes in response to
> a gen_server:call from another node; the binaries are identifiable as
> the various startup arguments passed when starting the processes.
> Background background: we're running out of memory (the node hits ~9GB
> resident), either because the beam is hoarding binaries, or because
> the binary heap is hugely fragmented. I'm trying to figure out which
> and solve the problem.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions