[erlang-bugs] inet_gethost (small) memory leak

Raimo Niskanen raimo+erlang-bugs@REDACTED
Mon Feb 2 14:26:35 CET 2009


On Fri, Jan 30, 2009 at 11:21:57AM -0700, Joseph Wecker 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.
> 

We have fixed a potential memory leak in our development branch for R13,
so can you test tonights snapshot with valgrind if it was
this memory leak we fixed...

http://www.erlang.org/download/snapshots/otp_src_R13A-0.tar.gz



> -Joseph
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list