[sr-dev] updated patch for dbtext

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 8 23:38:21 CEST 2014


Hello,

On 08/09/14 23:22, Luis Azedo wrote:
> Hi Daniel,
>
> i'm running a build from master
>
> Process::  ID=51 PID=7478 Type=slow timer
> Process::  ID=52 PID=7479 Type=timer
>
> memory from top
>  7479 kamailio  20   0 1224m *72m 5464 *S  0.3  1.9   0:00.68 kamailio
>  7478 kamailio  20   0 1224m *80m  13m *S  0.0  2.1   0:00.71 kamailio
>
> package and shared memory and constantly increasing on these processes 
> when i use the dbtext from master without the proposed patch.
usage of pkg and shm by db_text is not reflected by 'top' command line 
tool. Kamailio allocates the full size of pkg and shm zones at startup, 
then it does management of chunk allocations internally -- it has its 
own memory manager.

If you see increase of used memory via 'top' tool, then it is a leak in 
either an external library used for a module in that configuration or a 
module that has enabled use of system malloc (there are just few of 
them, mostly those related to MI/RPC, such as xmlrpc, ctl).

To look at used memory inside kamailio, use:

kamcmd pkg.stats
kamctl stats shmem

You can recompile and reinstall kamailio with:

MEMMNG=1
MEMDBG=1

Then set:

memlog=1
mem_summary=12

in kamailio.cfg and restart, let kamailio to run for a while until you 
think the leak has made some effects. Stop kamailio and you should see a 
summary with the used chunks of memory printed to syslog. You can send 
all those log messages to me to check if there is a leak in pkg or shm 
managed by kamailio. A leak is indicated by a high number of chunks 
allocated from same place, but you should filter out those allocated at 
startup (eg., parsing the cfg).

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20140908/6d63673e/attachment.html>


More information about the sr-dev mailing list