[Freeswitch-dev] memory leak in freeswitch?

Michael Jerris mike at jerris.com
Fri Oct 19 16:46:14 MSD 2012


Try running under valgrind?

On Oct 12, 2012, at 8:28 AM, rentmycoder rentmycoder
<rentmycoder at gmail.com> wrote:

> Hi guys,
>
> I've found a memory leak, and I need your great help to find why is
> this happening...
> The situation is simple: I execute a simple bash script using lua
> popen function as documented in wiki on an extension from the xml
> dialplan...
> After 1000 calls the memory usage gets 60Mb and after 10.000 calls, 120mb...
> Freeswitch becomes very unresponsive and after a time the sip profiles
> stop working...
> If I uncomment the popen call in lua, memory leak does not occure...
>
> The lua script:
>
> function shell(c)
>   local o, h
>   h = assert(io.popen(c,"r"))
>   o = h:read("*all")
>   h:close()
>   return o
> end
> sesson:answer();
> while(session.ready()) {
>    local testvar=shell(/opt/test.sh)
>    session:sleep(1000);
> }
> sesson:hangup();
>
>
>
> The test.sh script:
> !#/bin/bash
> echo 12345678901234567890123456789012345678901234567890123456789012345678901234567890
>
> Thats all... Tha script just writes to standard output and the lua
> script reads it into a variable...
>
> I would like to use this mechanism to communicate with an external process...
> This worked well with asterisk anyway...
>
> Question#1: what is the reason of this memory usage and how to fix it?
> Question#2: if not possible, how to communicate with an external
> process preferably via TCP?
> I've tried lua sockets, but same memory leaking occurred...
>
> Tested on: Freeswitch 1.2.3 on debian6 32bit, x86, 4GbRAM
> Stress test environment: another FS instance registers as a user and
> start calling target extension with a random (30-60 sec) call
> timeout...
> Monitors call count and if call count falls below 100, starts new
> calls as needed...
> So there are always 100 live concurrent incoming calls on the test
> system... which maximum length of 1 minute.
>
> Thanks a lot...
> John
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list