[SR-Users] private memory leak - but where?

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 20 10:56:32 CEST 2017


Hello,

my guess is that you define many cfg variables from lua, which take from
private memory (their definition).

So $sht(x=>abc) is defined when used first time and kept in memory. If
you use also $sht(x=>efg), this is another defined variable.

This happens when you do KSR.pv.get("$sht(x=>abc)") or
KSR.pv.get("$sht(x=>efg)")

To avoid defining a lot of variables, you can do:

KSR.pv.sets("$var(n)", "abc");
KSR.pv.get("$sht(x=>$var(n)");
KSR.pv.sets("$var(n)", "efg");
KSR.pv.get("$sht(x=>$var(n)");

The practically you define only one cfg variable,
KSR.pv.get("$sht(x=>$var(n)")

The issue is known, there were other reporting it here on the mailing
list. It's in my to-do before 5.1 to fix it in a way or another, by
either setting a limit of defined variables and then throw error
(easier), or track when a variable is used and start deleting the
definition for older ones when the limit is exceeded.

Cheers,
Daniel



On 19.09.17 17:56, Sebastian Damm wrote:
> Hi Daniel,
>
> thanks for the quick response. See my other mail with more details.
>
> I don't use cfg variable from the lua script, I only access $shv(...)
> and $vn(...) or $var(...) and $sht(...) from it. And of course $tU,
> $hdr(...) and other builtin variables. Some of the variables I'm
> accessing might not be there always, though ($au for example).
>
> Anything I can help with? I only need about half an hour to reproduce it.
>
> Best Regards,
> Sebastian
>
> On Tue, Sep 19, 2017 at 5:46 PM, Daniel-Constantin Mierla
> <miconda at gmail.com> wrote:
>> Hello,
>>
>> do you use kamailio.cfg variables in the lua script? If yes, can you
>> show how you do it?
>>
>> If you have troubles with pkg dump, it should be printed when you
>> stop/restart. It would be good to do the pkg summary, it is easier to
>> see the used chunks as a report. There are global parameters to
>> configure it.
>>
>> Cheers,
>> Daniel
>>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com




More information about the sr-users mailing list