[erlang-questions] VM leaking memory

Frank Muller frank.muller.erl@REDACTED
Wed Feb 6 18:46:30 CET 2019


Hi Michael

My sub_bin is built outside, but visible from inside the Fun’s scope.

/Frank


> On 2/6/19 2:53 AM, Frank Muller wrote:
> > Hello Michael and Fred
> >
> > Combing both solutions gave the best result. No need to even touch the
> > memory allocators at all and the system look stable for the last days.
> >
> > Michael: I’m passing a sub_binary to the child process created with
> > your sync_fun/2. Is it still a good idea to call binary:copy/1 on this
> > sub_bin inside the Fun? I think it’s useless because this process is
> > garbage collected ASAP anyway.
>
> It isn't necessary.  It should be better and simpler to only create a
> sub_binary inside the temporary process, but it may depend on your
> situation.  The reference counting will ensure all the binaries you need
> after the temporary process is done are kept and you don't need to do
> anything special for that to happen (only keep all the temporary
> binaries inside the temporary process).
>
> Best Regards,
> Michael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190206/26a0cf7d/attachment.htm>


More information about the erlang-questions mailing list