[Kamailio-Users] Perl module and memory leak in append_branch

James Puckett jpuckett at e-c-group.com
Wed Aug 26 16:13:39 CEST 2009


I have posted the log to http://cpem.stage2.net/kamailio-mem.log.   
This log contains 2000 calls of memory information.


James Puckett - Engineers' Consulting Group
Phone 229-316-0012 - Fax 229-316-1490




On Aug 26, 2009, at 7:31 AM, Daniel-Constantin Mierla wrote:

> Hello,
>
> On 26.08.2009 2:07 Uhr, James Puckett wrote:
>> I have followed a bit of the discussions regarding the problems  
>> with memory management between the perl modules and the core  
>> kamailio software.
> that is when calling functions exported by modules that need fixup.  
> For append_branch() should not be the case.
>>
>> I need to get append_branch working from within the perl module so  
>> that it doesn't cause a memory leak.  It's been a while since I did  
>> any serious straight C programming, but if someone can point me to  
>> the correct way to handle memory allocated with the module so that  
>> it gets freed in the core I'd be glad to take this problem on.
>>
>> Specifically, I'm using something that looks like:
>>
>> $m->append_branch("<sip:".$cdpn."\@".$peers{$_}."?From=%3Csip:". 
>> $sourcenumber."@".$destIp."%3E;tag=".$fromtag.">", $qval);
>>
>> This leaves about 190 bytes per call unfreed.
>
> Do you have the memory log? That will help to troubleshoot.
>
> Cheers,
> Daniel
>
> -- 
> Daniel-Constantin Mierla
> * http://www.asipto.com/
>





More information about the sr-users mailing list