Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4 Memory leak (version 0.6)

closed-works-for-me
None
5
2006-11-19
2005-07-22
Peter Parkkali
No

NetHogs (version 0.6, ie. current stable) seems to leak
quite a lot of memory. After running 'nethogs eth0' for
about 12 hours, the image had grown to about 160MB!

pfp@worf:~/nethogs$ ldd nethogs
libpcap.so.0.7 => /usr/lib/libpcap.so.0.7
(0xb7f32000)
libncurses.so.5 => /usr/lib/libncurses.so.5
(0xb7ef5000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5
(0xb7e3b000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6
(0xb7e19000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e0e000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6
(0xb7ce1000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2
(0xb7f61000)
pfp@worf:~/nethogs$ gcc --version
gcc (GCC) 3.3.5 (Debian 1:3.3.5-8ubuntu2)

-- peter.

Discussion

1 2 > >> (Page 1 of 2)
  • Arnout Engelen
    Arnout Engelen
    2005-08-27

    Logged In: YES
    user_id=392382

    This may be caused by a leak in libc (the getpwuid leak
    mentioned on
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=273051 ).
    In that case, a workaround is to change `compat' into
    `files' in /etc/nsswitch.conf (at your own risk :)).

    Does that seem to work for you?

    (btw, sorry for taking this long to respond to this report,
    I don't watch the sf.net space very closely)

     
  • Arnout Engelen
    Arnout Engelen
    2005-08-27

    • assigned_to: nobody --> raboofje
    • status: open --> pending
     
    • status: pending --> closed
     
  • Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • Peter Parkkali
    Peter Parkkali
    2005-09-12

    • status: closed --> open
     
  • Peter Parkkali
    Peter Parkkali
    2005-09-12

    Logged In: YES
    user_id=1109039

    Hi,

    I don't think this leak is caused by the libc bug. I tried
    changing s/compat/files/ in nsswitch.conf as per the
    instructions, but nethogs still keeps eating memory (the
    process image doubled in ~20 min).

    Also, the linked bug reports mention "... leak memory with
    each call to getpwuid() that results in an NIS lookup. " --
    I'm not, nor have I ever, used NIS; this machine only has
    account info in the traditional passwd+shadow files
    (Ubuntu's default setup).

    - peter

    [PS. Sorry for the slow response...]

     
  • Arnout Engelen
    Arnout Engelen
    2005-09-12

    Logged In: YES
    user_id=392382

    hum, that's indeed strange, i don't use NIS either, but
    s/compat/files/ in nsswitch.conf did seem to solve a rather
    serious memory leak.

    I don't seem to be able to reproduce the leaking here:

    4848 root 18 0 1552 1552 1208 R 99.0 0.6 0:20.24
    nethogs
    4848 root 15 0 1576 1576 1232 R 84.3 0.6 3:30.41
    nethogs
    4848 root 15 0 1576 1576 1232 R 97.4 0.6 17:13.61
    nethogs
    4848 root 18 0 1576 1576 1232 R 96.4 0.6 20:11.96
    nethogs

    Could you help me out a bit? Could you compile nethogs with
    the -g flag (line 14 of the Makefile), run "valgrind
    ./nethogs 2>valout.txt", then quit after it has leaked some
    and send me the resulting valout.txt?

     
  • Arnout Engelen
    Arnout Engelen
    2006-07-12

    Logged In: YES
    user_id=392382

    I have ubuntu now and still cannot reproduce the leak. Could
    you please run valgrind and send me the diagnostics as
    described in my previous message?

     
  • Arnout Engelen
    Arnout Engelen
    2006-11-04

    • status: open --> pending-works-for-me
     
1 2 > >> (Page 1 of 2)