[erlang-bugs] inet_gethost (small) memory leak

Bjorn Gustavsson bgustavsson@REDACTED
Sun Feb 1 09:27:58 CET 2009


On Fri, Jan 30, 2009 at 7:21 PM, Joseph Wecker <jwecker@REDACTED> wrote:
>
> I was running valgrind on my erlang program to find some memory leaks in
> a port program.  As expected, the erlang vm itself was very tight
> (compared to some python that ended up getting profiled, my C program,
> and even sed- throwing up memory leak errors all over the place).  For
> what it's worth though, there was one very small memory leak that
> Erlang itself was generating.  This may be a known problem already, or
> it may be too small to care- but it's the only one I saw:
>
> ==31273== 21 bytes in 1 blocks are definitely lost in loss record 1 of 2
> ==31273==    at 0x4025D2E: malloc (vg_replace_malloc.c:207)
> ==31273==    by 0x4025EAF: realloc (vg_replace_malloc.c:429)
> ==31273==    by 0x80497EE: (within
> /usr/lib/erlang/erts-5.6.3/bin/inet_gethost)
> ==31273==    by 0x804AF06: (within
> /usr/lib/erlang/erts-5.6.3/bin/inet_gethost)
> ==31273==    by 0x804BB34: (within
> /usr/lib/erlang/erts-5.6.3/bin/inet_gethost)
> ==31273==    by 0x4084684: (below main) (in
> /lib/tls/i686/cmov/libc-2.8.90.so)
>
>
> ==31275==
> ==31275== 21 bytes in 1 blocks are definitely lost in loss record 1 of 2
> ==31275==    at 0x4025D2E: malloc (vg_replace_malloc.c:207)
> ==31275==    by 0x4025EAF: realloc (vg_replace_malloc.c:429)
> ==31275==    by 0x80497EE: (within
> /usr/lib/erlang/erts-5.6.3/bin/inet_gethost)
> ==31275==    by 0x804AF06: (within
> /usr/lib/erlang/erts-5.6.3/bin/inet_gethost)
> ==31275==    by 0x804BB34: (within
> /usr/lib/erlang/erts-5.6.3/bin/inet_gethost)
> ==31275==    by 0x4084684: (below main) (in
> /lib/tls/i686/cmov/libc-2.8.90.so)
>
> etc.
> Wouldn't be surprised if it was coming from a system call- there may be
> nothing you can do about it, but I thought I'd bring it up as I
> couldn't find reference to this anywhere.

Thanks for finding this! We will investigate.

/Bjorn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list