[erlang-questions] VM leaking memory
Thu Jan 31 23:52:48 CET 2019
On 01/31, Scott Ribe wrote:
>> On Jan 31, 2019, at 3:26 PM, Frank Muller <frank.muller.erl@REDACTED> wrote:
>> The refc binary is the one using most of VM’s memory (in GB) compared to other allocators (few MB).
>So, could be the classic leak where you match on a binary and pass a sub-binary to another process? That creates a ref to the original binary, and if the first process is a long-lived one that doesn't gc often, even though the second one finishes, the original binary hangs around...
Yeah, that's a good bet. I'd check in the new feature where a sub-binary
of a large binary is taken, and would call `NewBin = binary:copy(Bin)`
on it to free the ref as early as possible.
More information about the erlang-questions