[Freeswitch-dev] memory leak in freeswitch?
Brian West
brian at freeswitch.org
Fri Oct 12 17:54:24 MSD 2012
Not sure we can say this enough. Report bugs to jira.
/b
On Oct 12, 2012, at 7:23 AM, rentmycoder rentmycoder 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
--
Brian West
brian at freeswitch.org
FreeSWITCH Solutions, LLC
PO BOX PO BOX 2531
Brookfield, WI 53008-2531
Twitter: @FreeSWITCH_Wire
http://freeswitchcookbook.com
http://freeswitchbook.com
T: +1.213.286.0410 | F: +1.213.286.0401 | M: +1.918.424.WEST
iNUM: +883 5100 1286 0410
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20121012/08c899df/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev
mailing list