<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1476216801148_371420"><span id="yui_3_16_0_ym19_1_1476216801148_371421">Holding a ref to a binary greater then 52 bytes keeps it from getting cleaned, under 52 bytes it gets copied.<br><br>To hold a ref you need to add that binary/iolist-member to a map/list or ets table.<br><br>If all your tcp process is doing is forwarding iolist/binary to another process for processing. That should not cause any issues.<br><br><br></span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Monday, October 17, 2016 7:26 AM, Oliver Korpilla <Oliver.Korpilla@gmx.de> wrote:<br></font></div> <br><br> <div class="y_msg_container">Hello.<br><br>Recent reading got me concerned about leaking memory by having big refc binaries.<br><br>In our system we have permanent TCP and SCTP handlers that receive outside messages, then forward it into the system for processing.<br><br>For example, these events have ASN.1 payloads. Decoding is done in throw-away processes... however, I'm concerned that the TCP and SCTP handling processes might cause memory leaks because every payload buffer is handled there first.<br><br>I saw in "Erlang in Anger" that routers should only return where to route to, not handle the message. But when handling sockets I don't see that option?<br><br>What is good practice here? Am "I" at risk?<br><br>Thanks and best regards,<br>Oliver<br>_______________________________________________<br>erlang-questions mailing list<br><a ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br><br></div> </div> </div> </div></div></body></html>