newsboat icon indicating copy to clipboard operation
newsboat copied to clipboard

Memory leak

Open arvedarved opened this issue 8 years ago • 1 comments

Newsboat version (copy from newsboat -v):

newsboat 2.10.1 System: FreeBSD 10.3-RELEASE-p11 (amd64) Compiler: g++ 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032) ncurses: ncurses 5.7.20081102 (compiled with 5.7) libcurl: libcurl/7.57.0 OpenSSL/1.0.1s zlib/1.2.8 nghttp2/1.28.0 (compiled with 7.56.1) SQLite: 3.21.0 (compiled with 3.21.0) libxml2: compiled with 2.9.4

Steps to reproduce the issue:

  1. Run newsboat for several days, observe growing memory usage or

  2. run newsboat under valgrind.

Sample Output from valgrind:

26942== 8,000 bytes in 100 blocks are definitely lost in loss record 192 of 217 ==26942== at 0x4C245F7: calloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) ==26942== by 0x4E385AB: pthread_mutex_init (in /lib/libthr.so.3) ==26942== by 0x651C661: stfl_ipool_create (iconv.c:49) ==26942== by 0x4ED60E: newsbeuter::utils::str2wstr(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) (utils.cpp:581)

Just starting newsboat reading one entry and exit results in 96 Entries of definetly lost memory.

I am not sure if the source of the problem is in stfl, or if newsboat is using stfl the wrong way.

arvedarved avatar Dec 15 '17 15:12 arvedarved

Thank you for the report. Newsboat definitely leaks a lot right after first update, and then very slowly while in use. Unfortunatelly, noone investigated it yet, and I'm currently exploring another part of the code, so don't know when I'll get to this myself.

Minoru avatar Dec 15 '17 18:12 Minoru