<div dir="ltr">Hello!<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 13, 2018 at 11:08 PM Jonas Falkevik <<a href="mailto:jonas.falkevik@mobilearts.com">jonas.falkevik@mobilearts.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div>I think I was able to reproduce this problem.</div><div>And to me it looks like a bug.</div><div>On my system the packet_inet_input is called but the recv call returns eagain.</div><div>This isn’t freeing the buffer so the realloc (intended for fragments?) are trigged.</div><div>Reallocating the same size buffer again.</div><div><br></div><div>The below branch with the below change reduced the reallocs on my linux system.</div><div><a href="https://github.com/falkevik/otp/tree/udp_performance_bug" target="_blank">https://github.com/falkevik/otp/tree/udp_performance_bug</a></div><div><br></div><div><a href="https://github.com/falkevik/otp/commit/ca08458a0663792390d5e89f83b883e19a33054c" target="_blank">https://github.com/falkevik/otp/commit/ca08458a0663792390d5e89f83b883e19a33054c</a></div><div><br></div></div></blockquote><div><br></div><div>Interesting... I wonder if maybe it wouldn't be better to solve this problem in the code for realloc so that no copy is done when a realloc of the same size if issued... that way we solve it in all places instead of only in the inet_driver</div><div><br></div><div>Lukas</div></div></div>