[erlang-questions] Why am I seeing RefcBinary with length < 64?

Roger Lipscombe roger@REDACTED
Wed Dec 20 15:52:31 CET 2017

On 20 December 2017 at 14:32, Jan Chochol <jan.chochol@REDACTED> wrote:
> Hi,
> It is possible that these binaries comes as part of larger binaries (also
> called sub binaries).

Is there any way to figure this out in gdb?

> Some information are available at
> http://erlang.org/doc/efficiency_guide/binaryhandling.html .
> Sub binaries only store reference to originating binary and length - it also
> mean, that originating binary can not be freed.

Would I be correct in assuming that, because these binaries come
directly from a cross-node gen_server:call, there *is* no large binary
for them to be sub-binaries of? Or are they sub-binaries of the
cross-node message?

> 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).

Yeah. I've seen that. Before I add these to arbitrary places all over
my code, I'd rather figure out the root cause.


More information about the erlang-questions mailing list