That report showed me 2 leaks.<div><br></div><div>1) in mod_cdr_sqlite where it was expanding a variable template and not checking if it needed to free the results.</div><div>2) in mod_dptools in the user channel code.</div>
<div><br></div><div>Wait, there&#39;s more.</div><div><br></div><div>Fixing the leak in the user channel then led me to realize there was a regression in the change that introduced that leak that was breaking the code that copies all the variables from the {} into the far end channel.</div>
<div><br></div><div>anyway, try out GIT head.</div><div><br><br><div class="gmail_quote">On Tue, Nov 15, 2011 at 3:25 AM, François Delawarde <span dir="ltr">&lt;<a href="mailto:fdelawarde@wirelessmundi.com">fdelawarde@wirelessmundi.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I did a small valgrind test with git HEAD:<br>
1. turn on, make 5 calls or so<br>
2. leave FS on for the night (without calls)<br>
3. shut it down cleanly in the morning<br>
<br>
During execution, some &quot;Warning: invalid file descriptor -1 in syscall<br>
close()&quot; (4-5 for each call + some extras).<br>
<br>
After shutting down, something strikes me in the vg.log file:<br>
&quot;definitely lost: 173,407,885 bytes in 84,680 blocks&quot;<br>
<br>
Is this normal?<br>
<br>
valgrind log: <a href="http://pastebin.freeswitch.org/17779" target="_blank">http://pastebin.freeswitch.org/17779</a><br>
<br>
Thanks,<br>
<font color="#888888">François.<br>
</font><div><div></div><div class="h5"><br>
<br>
On Mon, 2011-11-14 at 11:41 -0600, Anthony Minessale wrote:<br>
&gt; valgrind is your best bet:<br>
&gt;<br>
&gt; valgrind --tool=memcheck --log-file=vg.log --leak-check=full<br>
&gt; --leak-resolution=high<br>
&gt; --show-reachable=yes /usr/local/freeswitch/bin/freeswitch -vg<br>
&gt;<br>
&gt;<br>
&gt; run this on normal traffic for a while and get the log file.<br>
&gt;<br>
&gt;<br>
&gt; if you unload mods it would not help with a leak but it would with a<br>
&gt; swelling pool.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Nov 14, 2011 at 11:30 AM, François Delawarde<br>
&gt; &lt;<a href="mailto:fdelawarde@wirelessmundi.com">fdelawarde@wirelessmundi.com</a>&gt; wrote:<br>
&gt;         Hello,<br>
&gt;<br>
&gt;         I&#39;m experiencing what I think is a memory leak in a production<br>
&gt;         system<br>
&gt;         with a recent git (2-Nov), with FS consuming &gt;5GB and<br>
&gt;         increasing after a<br>
&gt;         few days with never more than 10 calls at once.<br>
&gt;<br>
&gt;         While the users are not experiencing problems so far, I&#39;m a<br>
&gt;         bit worried.<br>
&gt;         So I have a few questions:<br>
&gt;<br>
&gt;         - How can I be sure it&#39;s a leak and not some memory pool thing<br>
&gt;         that FS<br>
&gt;         would free when the system needs (system has 10GB total)?<br>
&gt;<br>
&gt;         - If I unload modules one by one, is the memory used by this<br>
&gt;         module<br>
&gt;         freed immediately?<br>
&gt;<br>
&gt;         - What would be a &quot;good&quot; way to try and narrow down the cause?<br>
&gt;         Is<br>
&gt;         valgrind a good tool for that?<br>
&gt;<br>
&gt;         Of course I&#39;ll try with GIT HEAD and try my best to find the<br>
&gt;         cause<br>
&gt;         before considering to add a new Jira issue, otherwise it&#39;s<br>
&gt;         quite<br>
&gt;         useless.<br>
&gt;<br>
&gt;<br>
&gt;         Thanks,<br>
&gt;         François.<br>
&gt;<br>
&gt;<br>
&gt;         _________________________________________________________________________<br>
&gt;         Professional FreeSWITCH Consulting Services:<br>
&gt;         <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt;         <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt;         FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt;         <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt;         Official FreeSWITCH Sites<br>
&gt;         <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;         <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt;         <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt;         FreeSWITCH-dev mailing list<br>
&gt;         <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt;         <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;         UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt;         <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Anthony Minessale II<br>
&gt;<br>
&gt; FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
&gt; ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
&gt; Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
&gt;<br>
&gt; AIM: anthm<br>
&gt; <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
&gt; GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
&gt; IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
&gt;<br>
&gt; FreeSWITCH Developer Conference<br>
&gt; <a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
&gt; <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
&gt; pstn:<a href="tel:%2B19193869900" value="+19193869900">+19193869900</a><br>
&gt; _________________________________________________________________________<br>
&gt; Professional FreeSWITCH Consulting Services:<br>
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt; Official FreeSWITCH Sites<br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt; FreeSWITCH-dev mailing list<br>
&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div>