[erlang-questions] VM leaking memory

Frank Muller frank.muller.erl@REDACTED
Fri Feb 1 06:12:53 CET 2019

The original proxy design was like this:

External TCP Source -> Proxy Process (binary transformation and analysis)
-> External TCP Sink

The current design added a new stage to the proxy by having 2 processes
instead of 1:

External TCP Source -> Proxy Process1 -> Proxy Process2 -> External TCP Sink

Process1 forward the binaries (>64B) to Process2  which also inspects them
(by logging suspicious packets).

I will perform more checks today and report back.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190201/49e4e998/attachment.htm>

More information about the erlang-questions mailing list