This if you think that is repeatable and really a leak, you should run FS under valgrind then report the issue via JIRA On 10/12/12 7:23 AM, "rentmycoder rentmycoder" <rentmycoder@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 123456789012345678901234567890123456789012345678901234567890123456789012345678 90
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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Ken http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org irc.freenode.net #freeswitch