[erlang-bugs] inet_gethost (small) memory leak

Joseph Wecker <>
Fri Jan 30 19:21:57 CET 2009


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.

-Joseph



More information about the erlang-bugs mailing list