Re: Icecast 2.4 beta4 memory leak
"Thomas B. Rücker" <[email protected]>
| Newsgroups | gmane.comp.audio.icecast.devel |
|---|---|
| Message-ID | <[email protected]> |
On 01/26/2014 06:56 AM, "Thomas B. Rücker" wrote: > Hi, > > On 01/25/2014 11:47 PM, [email protected] wrote: >> I have tested the newly released IceCast 2.4beta4 and again found a >> noticeable memory leak in it. > Can you please run Icecast under Valgrind? > I'm personally using: > valgrind -v --time-stamp=yes --leak-check=full --show-reachable=yes > icecast -c /etc/icecast2/icecast.xml To do live checking, without needing to terminate Icecast, I have patched my local Icecast build with Valgrind instrumentation. See attached patch. Admin interface requests trigger Valgrind output on the console: - "/admin/listmounts.xsl" - |VALGRIND_DO_ADDED_LEAK_CHECK| - "/admin/stats.xsl" - |VALGRIND_DO_LEAK_CHECK| From Valgrind docs: * |VALGRIND_DO_LEAK_CHECK|: does a full memory leak check (like |--leak-check=full|) right now. This is useful for incrementally checking for leaks between arbitrary places in the program's execution. It has no return value. * |VALGRIND_DO_ADDED_LEAK_CHECK|: same as |VALGRIND_DO_LEAK_CHECK| but only shows the entries for which there was an increase in leaked bytes or leaked number of blocks since the previous leak search. It has no return value. I'm now monitoring my test setup, but have yet to see any suspicious increase in memory consumption. This makes me suspect, that there is a difference in my setup, either in how Icecast gets used or in how it was compiled. I remember tracing a weird libXML2 memory leak on Fedora a few years ago that showed up in Icecast as it leaked memory on every web interface request. > With our experiments so far we were not able to see such massive leaks. > It would also help to know more about your setup. > Which distro is this on? Which version of it? > Built from source? OBS package? > > >> This time it is even larger than in the beta3 version. >> Here is the graph similar to the one I prepared last time: >> http://ftp.wombat.org.ua/IceCast-2_4_beta4-memory_leak.png >> > By the looks of it each stream leaks something in your case. > How long are the songs you have in the playlists (Wondering how often it > gets metadata updates). One thing I noticed from the 2.3.99.3 graph is that there the leak seemed to only occur for ices0. The 2.3.99.4 graph has it active all the time, so it's hard to tell, what's interesting though, is that ices2 now seems to have an impact on the growth rate. But without knowing more about the setup, server config, etc - it's impossible to tell what really happens. > Really appreciate your help, as we want to make a good 2.4 release soon. Cheers Thomas _______________________________________________ Icecast-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/icecast-dev
icecast-valgrind-hack.patch
(text/x-patch, 760 B)
Index: src/admin.c
===================================================================
--- src/admin.c (revision 19073)
+++ src/admin.c (working copy)
@@ -39,6 +39,9 @@
#include "logging.h"
#include "auth.h"
+
+#include "valgrind/memcheck.h"
+
#ifdef _WIN32
#define snprintf _snprintf
#endif
@@ -470,9 +473,11 @@
break;
case COMMAND_TRANSFORMED_STATS:
command_stats(client, NULL, TRANSFORMED);
+ VALGRIND_DO_LEAK_CHECK;
break;
case COMMAND_TRANSFORMED_LIST_MOUNTS:
command_list_mounts(client, TRANSFORMED);
+ VALGRIND_DO_ADDED_LEAK_CHECK;
break;
case COMMAND_TRANSFORMED_LISTSTREAM:
command_list_mounts(client, TRANSFORMED);