Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-05-03 Thread Daniel-Constantin Mierla
To close this: patches for db_cluster and htable rpc db reload commands
were backported to 5.0 branch.

Cheers, Daniel


On 02.05.17 15:14, Daniel-Constantin Mierla wrote:
>
> Hello,
>
> thanks for clarifications, good to know that the other was related to
> this and nothing to look for more.
>
> The PR was merged and it will be backported.
>
> Cheers, Daniel
>
>
> On 02.05.17 09:29, Kristian F. Høgh wrote:
>>
>> Hi Daniel,
>>
>>  
>>
>> The memory leak appears, when reloading a htable from database
>> without rows.
>>
>> It is not related to db_cluster.
>>
>>  
>>
>> I got confused by reloading one htable (with data) didn't have memory
>> leak.
>>
>> When I reloaded another (without data), the memory leak appeared.
>>
>>  
>>
>> Regards,
>>
>> Kristian.
>>
>>  
>>
>> On Tuesday, May 2, 2017 9:14:45 AM CEST Daniel-Constantin Mierla wrote:
>>
>> > Hello,
>>
>> >
>>
>> > ok, thanks, I will review and merge.
>>
>> >
>>
>> > To clarify, this is no longer related to reloading one or more tables,
>>
>> > right? And is it specific for usage with db_cluster or not?
>>
>> >
>>
>> > Cheers, Daniel
>>
>> >
>>
>> >
>>
>> > On 02.05.17 08:06, Kristian F. Høgh wrote:
>>
>> > >
>>
>> > > Hi
>>
>> > >
>>
>> > >
>>
>> > >
>>
>> > > The leak is only when reloading an empty htable.
>>
>> > >
>>
>> > > I created a pull request
>> (https://github.com/kamailio/kamailio/pull/1110)
>>
>> > >
>>
>> > >
>>
>> > >
>>
>> > > Regards,
>>
>> > >
>>
>> > > Kristian.
>>
>> > >
>>
>> > >
>>
>> > >
>>
>> > > On Friday, April 28, 2017 1:56:51 PM CEST Kristian F. Høgh wrote:
>>
>> > >
>>
>> > > > Hi,
>>
>> > >
>>
>> > > >
>>
>> > >
>>
>> > > > I did some more testing.
>>
>> > >
>>
>> > > >
>>
>> > >
>>
>> > > > reloading address and domain is fixed in master
>>
>> > > (08f8e0bc72b9f16f76b78110c9c95b1ba7f1ce25)
>>
>> > >
>>
>> > > > If I only have one htable, I can reload many times without memory
>>
>> > > leak. (The content i database is unchanged)
>>
>> > >
>>
>> > > > If I have 2 htables and keep reloading both, kamailio leaks as
>>
>> > > below. (The content i database is unchanged)
>>
>> > >
>>
>> > > >
>>
>> > >
>>
>> > > > Regards,
>>
>> > >
>>
>> > > > Kristian.
>>
>> > >
>>
>> > > >
>>
>> > >
>>
>> > > >
>>
>> > >
>>
>> > > > On Friday, April 28, 2017 11:20:29 AM CEST Kristian F. Høgh wrote:
>>
>> > >
>>
>> > > > > Hi Daniel.
>>
>> > >
>>
>> > > > >
>>
>> > >
>>
>> > > > > Thanks alot.
>>
>> > >
>>
>> > > > > It fixed the problem at my testbed.
>>
>> > >
>>
>> > > > > In production i reload several htables + address and domain, so I
>>
>> > > updated my config.
>>
>> > >
>>
>> > > > >
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: 1700. N address=0x7f9bf03905e8
>>
>> > > frag=0x7f9bf03905b0 size=64 used=1
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
>>
>> > > db_mysql_get_columns(77)
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>>
>> > > c0c0c0c0, abcdefed
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: 1701. N address=0x7f9bf0390690
>>
>> > > frag=0x7f9bf0390658 size=64 used=1
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
>>
>> > > db_allocate_columns(150)
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>>
>> > > c0c0c0c0, abcdefed
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: 1702. N address=0x7f9bf0390738
>>
>> > > frag=0x7f9bf0390700 size=64 used=1
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
>>
>> > > db_allocate_columns(160)
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>>
>> > > c0c0c0c0, abcdefed
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: 1703. N address=0x7f9bf03907e0
>>
>> > > frag=0x7f9bf03907a8 size=64 used=1
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
>>
>> > > db_new_result(114)
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>>
>> > > c0c0c0c0, abcdefed
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: 1706. N address=0x7f9bf0390a58
>>
>> > > frag=0x7f9bf0390a20 size=64 used=1
>>
>> > >
>>
>> > > > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
>>
>> > > db_mysql_new_result(236)
>>
>> > >
>>
>> > > > >
>>
>> > >
>>
>> > > > > Regards,
>>
>> > >
>>
>> > > > > Kristian.
>>
>> > >
>>
>> > > > >
>>
>> > >
>>
>> > > > > On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin
>> Mierla
>>
>> > > wrote:
>>
>> > >
>>
>> > > > > > Hello,
>>
>> > >
>>
>> > > > > >
>>
>> > >
>>
>> > > > > > can you fetch the master and try again -- I just pushed
>> some fixes.
>>
>> > >
>>
>> > > > > >
>>
>> > >
>>
>> > > > > > Cheers,
>>
>> > >
>>
>> > > > > > Daniel
>>
>> > >
>>
>> > > > > >
>>
>> > >
>>
>> > > > > >
>>
>> > >
>>
>> > > > > > On 28.04.17 08:17, Kristian F. Høgh wrote:
>>
>> > >
>>
>> > > > > > > Hi list,
>>
>> > >
>>
>> > > > > > >
>>
>> > >
>>
>> > > > > > > I use current git master.
>

Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-05-02 Thread Daniel-Constantin Mierla
Hello,

thanks for clarifications, good to know that the other was related to
this and nothing to look for more.

The PR was merged and it will be backported.

Cheers, Daniel


On 02.05.17 09:29, Kristian F. Høgh wrote:
>
> Hi Daniel,
>
>  
>
> The memory leak appears, when reloading a htable from database without
> rows.
>
> It is not related to db_cluster.
>
>  
>
> I got confused by reloading one htable (with data) didn't have memory
> leak.
>
> When I reloaded another (without data), the memory leak appeared.
>
>  
>
> Regards,
>
> Kristian.
>
>  
>
> On Tuesday, May 2, 2017 9:14:45 AM CEST Daniel-Constantin Mierla wrote:
>
> > Hello,
>
> >
>
> > ok, thanks, I will review and merge.
>
> >
>
> > To clarify, this is no longer related to reloading one or more tables,
>
> > right? And is it specific for usage with db_cluster or not?
>
> >
>
> > Cheers, Daniel
>
> >
>
> >
>
> > On 02.05.17 08:06, Kristian F. Høgh wrote:
>
> > >
>
> > > Hi
>
> > >
>
> > >
>
> > >
>
> > > The leak is only when reloading an empty htable.
>
> > >
>
> > > I created a pull request
> (https://github.com/kamailio/kamailio/pull/1110)
>
> > >
>
> > >
>
> > >
>
> > > Regards,
>
> > >
>
> > > Kristian.
>
> > >
>
> > >
>
> > >
>
> > > On Friday, April 28, 2017 1:56:51 PM CEST Kristian F. Høgh wrote:
>
> > >
>
> > > > Hi,
>
> > >
>
> > > >
>
> > >
>
> > > > I did some more testing.
>
> > >
>
> > > >
>
> > >
>
> > > > reloading address and domain is fixed in master
>
> > > (08f8e0bc72b9f16f76b78110c9c95b1ba7f1ce25)
>
> > >
>
> > > > If I only have one htable, I can reload many times without memory
>
> > > leak. (The content i database is unchanged)
>
> > >
>
> > > > If I have 2 htables and keep reloading both, kamailio leaks as
>
> > > below. (The content i database is unchanged)
>
> > >
>
> > > >
>
> > >
>
> > > > Regards,
>
> > >
>
> > > > Kristian.
>
> > >
>
> > > >
>
> > >
>
> > > >
>
> > >
>
> > > > On Friday, April 28, 2017 11:20:29 AM CEST Kristian F. Høgh wrote:
>
> > >
>
> > > > > Hi Daniel.
>
> > >
>
> > > > >
>
> > >
>
> > > > > Thanks alot.
>
> > >
>
> > > > > It fixed the problem at my testbed.
>
> > >
>
> > > > > In production i reload several htables + address and domain, so I
>
> > > updated my config.
>
> > >
>
> > > > >
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: 1700. N address=0x7f9bf03905e8
>
> > > frag=0x7f9bf03905b0 size=64 used=1
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
>
> > > db_mysql_get_columns(77)
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>
> > > c0c0c0c0, abcdefed
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: 1701. N address=0x7f9bf0390690
>
> > > frag=0x7f9bf0390658 size=64 used=1
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
>
> > > db_allocate_columns(150)
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>
> > > c0c0c0c0, abcdefed
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: 1702. N address=0x7f9bf0390738
>
> > > frag=0x7f9bf0390700 size=64 used=1
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
>
> > > db_allocate_columns(160)
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>
> > > c0c0c0c0, abcdefed
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: 1703. N address=0x7f9bf03907e0
>
> > > frag=0x7f9bf03907a8 size=64 used=1
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
>
> > > db_new_result(114)
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
>
> > > c0c0c0c0, abcdefed
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: 1706. N address=0x7f9bf0390a58
>
> > > frag=0x7f9bf0390a20 size=64 used=1
>
> > >
>
> > > > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
>
> > > db_mysql_new_result(236)
>
> > >
>
> > > > >
>
> > >
>
> > > > > Regards,
>
> > >
>
> > > > > Kristian.
>
> > >
>
> > > > >
>
> > >
>
> > > > > On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin Mierla
>
> > > wrote:
>
> > >
>
> > > > > > Hello,
>
> > >
>
> > > > > >
>
> > >
>
> > > > > > can you fetch the master and try again -- I just pushed some
> fixes.
>
> > >
>
> > > > > >
>
> > >
>
> > > > > > Cheers,
>
> > >
>
> > > > > > Daniel
>
> > >
>
> > > > > >
>
> > >
>
> > > > > >
>
> > >
>
> > > > > > On 28.04.17 08:17, Kristian F. Høgh wrote:
>
> > >
>
> > > > > > > Hi list,
>
> > >
>
> > > > > > >
>
> > >
>
> > > > > > > I use current git master.
>
> > >
>
> > > > > > > When I reload a htable using "kamcmd htable.reload htable1",
>
> > > the "ctl handler" process leaks 384 bytes of pkg memory
>
> > >
>
> > > > > > > If I use a direct mysql connection without db_cluster, the is
>
> > > no memory leak
>
> > >
>
> > > > > > >
>
> > >
>
> > > > > > > modparam("db_cluster", "connection",
>
> > > "con1=>mysql://user:p...@ip.addr/database")
>
> > >
>
> > > > > > > modparam("db_cluster", "connection",
>
> > > "con2=>mysql://user:pass@ip.addr2/database")
>
> > >
>

Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-05-02 Thread Kristian F . Høgh
Hi Daniel,

The memory leak appears, when reloading a htable from database without rows.
It is not related to db_cluster.

I got confused by reloading one htable (with data) didn't have memory leak.
When I reloaded another (without data), the memory leak appeared.

Regards,
Kristian.

On Tuesday, May 2, 2017 9:14:45 AM CEST Daniel-Constantin Mierla wrote:
> Hello,
> 
> ok, thanks, I will review and merge.
> 
> To clarify, this is no longer related to reloading one or more tables,
> right? And is it specific for usage with db_cluster or not?
> 
> Cheers, Daniel
> 
> 
> On 02.05.17 08:06, Kristian F. Høgh wrote:
> >
> > Hi
> >
> >  
> >
> > The leak is only when reloading an empty htable.
> >
> > I created a pull request (https://github.com/kamailio/kamailio/pull/1110)
> >
> >  
> >
> > Regards,
> >
> > Kristian.
> >
> >  
> >
> > On Friday, April 28, 2017 1:56:51 PM CEST Kristian F. Høgh wrote:
> >
> > > Hi,
> >
> > >
> >
> > > I did some more testing.
> >
> > >
> >
> > > reloading address and domain is fixed in master
> > (08f8e0bc72b9f16f76b78110c9c95b1ba7f1ce25)
> >
> > > If I only have one htable, I can reload many times without memory
> > leak. (The content i database is unchanged)
> >
> > > If I have 2 htables and keep reloading both, kamailio leaks as
> > below. (The content i database is unchanged)
> >
> > >
> >
> > > Regards,
> >
> > > Kristian.
> >
> > >
> >
> > >
> >
> > > On Friday, April 28, 2017 11:20:29 AM CEST Kristian F. Høgh wrote:
> >
> > > > Hi Daniel.
> >
> > > >
> >
> > > > Thanks alot.
> >
> > > > It fixed the problem at my testbed.
> >
> > > > In production i reload several htables + address and domain, so I
> > updated my config.
> >
> > > >
> >
> > > > 16(31430) ALERT: qm_status: 1700. N address=0x7f9bf03905e8
> > frag=0x7f9bf03905b0 size=64 used=1
> >
> > > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
> > db_mysql_get_columns(77)
> >
> > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> > c0c0c0c0, abcdefed
> >
> > > > 16(31430) ALERT: qm_status: 1701. N address=0x7f9bf0390690
> > frag=0x7f9bf0390658 size=64 used=1
> >
> > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
> > db_allocate_columns(150)
> >
> > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> > c0c0c0c0, abcdefed
> >
> > > > 16(31430) ALERT: qm_status: 1702. N address=0x7f9bf0390738
> > frag=0x7f9bf0390700 size=64 used=1
> >
> > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
> > db_allocate_columns(160)
> >
> > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> > c0c0c0c0, abcdefed
> >
> > > > 16(31430) ALERT: qm_status: 1703. N address=0x7f9bf03907e0
> > frag=0x7f9bf03907a8 size=64 used=1
> >
> > > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
> > db_new_result(114)
> >
> > > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> > c0c0c0c0, abcdefed
> >
> > > > 16(31430) ALERT: qm_status: 1706. N address=0x7f9bf0390a58
> > frag=0x7f9bf0390a20 size=64 used=1
> >
> > > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
> > db_mysql_new_result(236)
> >
> > > >
> >
> > > > Regards,
> >
> > > > Kristian.
> >
> > > >
> >
> > > > On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin Mierla
> > wrote:
> >
> > > > > Hello,
> >
> > > > >
> >
> > > > > can you fetch the master and try again -- I just pushed some fixes.
> >
> > > > >
> >
> > > > > Cheers,
> >
> > > > > Daniel
> >
> > > > >
> >
> > > > >
> >
> > > > > On 28.04.17 08:17, Kristian F. Høgh wrote:
> >
> > > > > > Hi list,
> >
> > > > > >
> >
> > > > > > I use current git master.
> >
> > > > > > When I reload a htable using "kamcmd htable.reload htable1",
> > the "ctl handler" process leaks 384 bytes of pkg memory
> >
> > > > > > If I use a direct mysql connection without db_cluster, the is
> > no memory leak
> >
> > > > > >
> >
> > > > > > modparam("db_cluster", "connection",
> > "con1=>mysql://user:p...@ip.addr/database")
> >
> > > > > > modparam("db_cluster", "connection",
> > "con2=>mysql://user:pass@ip.addr2/database")
> >
> > > > > > modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
> >
> > > > > >
> >
> > > > > > modparam("htable", "db_url", "cluster://cls1")
> >
> > > > > > # modparam("htable", "db_url",
> > "mysql://user:p...@ip.addr/database"
> >
> > > > > > modparam("htable", "htable",
> > "htable1=>size=8;autoexpire=0;dbtable=htable1;")
> >
> > > > > >
> >
> > > > > > 16(10429) ALERT: qm_status: 6513. N address=0x7f4e65e01720
> > frag=0x7f4e65e016e8 size=128 used=1
> >
> > > > > > 16(10429) ALERT: qm_status: alloc'd from db_cluster:
> > dbcl_api.c: db_cluster_init(294)
> >
> > > > > > 16(10429) ALERT: qm_status: start check=f0f0f0f0, end check=
> > c0c0c0c0, abcdefed
> >
> > > > > > 16(10429) ALERT: qm_status: 6514. N address=0x7f4e65e01808
> > frag=0x7f4e65e017d0 size=128 used=1
> >
> > > > > > 16(10429) ALERT: qm_status: alloc'd from core: db.c:
> > db_do_init2(298)
> >
> > > > > > 16(10429) ALERT: qm_statu

Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-05-02 Thread Daniel-Constantin Mierla
Hello,

ok, thanks, I will review and merge.

To clarify, this is no longer related to reloading one or more tables,
right? And is it specific for usage with db_cluster or not?

Cheers, Daniel


On 02.05.17 08:06, Kristian F. Høgh wrote:
>
> Hi
>
>  
>
> The leak is only when reloading an empty htable.
>
> I created a pull request (https://github.com/kamailio/kamailio/pull/1110)
>
>  
>
> Regards,
>
> Kristian.
>
>  
>
> On Friday, April 28, 2017 1:56:51 PM CEST Kristian F. Høgh wrote:
>
> > Hi,
>
> >
>
> > I did some more testing.
>
> >
>
> > reloading address and domain is fixed in master
> (08f8e0bc72b9f16f76b78110c9c95b1ba7f1ce25)
>
> > If I only have one htable, I can reload many times without memory
> leak. (The content i database is unchanged)
>
> > If I have 2 htables and keep reloading both, kamailio leaks as
> below. (The content i database is unchanged)
>
> >
>
> > Regards,
>
> > Kristian.
>
> >
>
> >
>
> > On Friday, April 28, 2017 11:20:29 AM CEST Kristian F. Høgh wrote:
>
> > > Hi Daniel.
>
> > >
>
> > > Thanks alot.
>
> > > It fixed the problem at my testbed.
>
> > > In production i reload several htables + address and domain, so I
> updated my config.
>
> > >
>
> > > 16(31430) ALERT: qm_status: 1700. N address=0x7f9bf03905e8
> frag=0x7f9bf03905b0 size=64 used=1
>
> > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
> db_mysql_get_columns(77)
>
> > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > 16(31430) ALERT: qm_status: 1701. N address=0x7f9bf0390690
> frag=0x7f9bf0390658 size=64 used=1
>
> > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
> db_allocate_columns(150)
>
> > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > 16(31430) ALERT: qm_status: 1702. N address=0x7f9bf0390738
> frag=0x7f9bf0390700 size=64 used=1
>
> > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
> db_allocate_columns(160)
>
> > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > 16(31430) ALERT: qm_status: 1703. N address=0x7f9bf03907e0
> frag=0x7f9bf03907a8 size=64 used=1
>
> > > 16(31430) ALERT: qm_status: alloc'd from core: db_res.c:
> db_new_result(114)
>
> > > 16(31430) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > 16(31430) ALERT: qm_status: 1706. N address=0x7f9bf0390a58
> frag=0x7f9bf0390a20 size=64 used=1
>
> > > 16(31430) ALERT: qm_status: alloc'd from db_mysql: km_res.c:
> db_mysql_new_result(236)
>
> > >
>
> > > Regards,
>
> > > Kristian.
>
> > >
>
> > > On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin Mierla
> wrote:
>
> > > > Hello,
>
> > > >
>
> > > > can you fetch the master and try again -- I just pushed some fixes.
>
> > > >
>
> > > > Cheers,
>
> > > > Daniel
>
> > > >
>
> > > >
>
> > > > On 28.04.17 08:17, Kristian F. Høgh wrote:
>
> > > > > Hi list,
>
> > > > >
>
> > > > > I use current git master.
>
> > > > > When I reload a htable using "kamcmd htable.reload htable1",
> the "ctl handler" process leaks 384 bytes of pkg memory
>
> > > > > If I use a direct mysql connection without db_cluster, the is
> no memory leak
>
> > > > >
>
> > > > > modparam("db_cluster", "connection",
> "con1=>mysql://user:p...@ip.addr/database")
>
> > > > > modparam("db_cluster", "connection",
> "con2=>mysql://user:pass@ip.addr2/database")
>
> > > > > modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
>
> > > > >
>
> > > > > modparam("htable", "db_url", "cluster://cls1")
>
> > > > > # modparam("htable", "db_url",
> "mysql://user:p...@ip.addr/database"
>
> > > > > modparam("htable", "htable",
> "htable1=>size=8;autoexpire=0;dbtable=htable1;")
>
> > > > >
>
> > > > > 16(10429) ALERT: qm_status: 6513. N address=0x7f4e65e01720
> frag=0x7f4e65e016e8 size=128 used=1
>
> > > > > 16(10429) ALERT: qm_status: alloc'd from db_cluster:
> dbcl_api.c: db_cluster_init(294)
>
> > > > > 16(10429) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > > > 16(10429) ALERT: qm_status: 6514. N address=0x7f4e65e01808
> frag=0x7f4e65e017d0 size=128 used=1
>
> > > > > 16(10429) ALERT: qm_status: alloc'd from core: db.c:
> db_do_init2(298)
>
> > > > > 16(10429) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > > > 16(10429) ALERT: qm_status: 6515. N address=0x7f4e65e018f0
> frag=0x7f4e65e018b8 size=128 used=1
>
> > > > > 16(10429) ALERT: qm_status: alloc'd from core: db.c:
> db_do_init2(298)
>
> > > > > 16(10429) ALERT: qm_status: start check=f0f0f0f0, end check=
> c0c0c0c0, abcdefed
>
> > > > >
>
> > > > > Regards,
>
> > > > > Kristian Høgh
>
> > > > > Uni-tel A/S
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > ___
>
> > > > > Kamailio (SER) - Users Mailing List
>
> > > > > sr-users@lists.kamailio.org
>
> > > > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> > > >
>
> > > >
>
> > >
>
> > >
>
> > > 

Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-05-01 Thread Kristian F . Høgh
Hi

The leak is only when reloading an empty htable.
I created a pull request (https://github.com/kamailio/kamailio/pull/1110)

Regards,
Kristian.

On Friday, April 28, 2017 1:56:51 PM CEST Kristian F. Høgh wrote:
> Hi,
> 
> I did some more testing.
> 
> reloading address and domain is fixed in master 
> (08f8e0bc72b9f16f76b78110c9c95b1ba7f1ce25)
> If I only have one htable, I can reload many times without memory leak. (The 
> content i database is unchanged)
> If I have 2 htables and keep reloading both, kamailio leaks as below. (The 
> content i database is unchanged)
> 
> Regards,
> Kristian.
> 
> 
> On Friday, April 28, 2017 11:20:29 AM CEST Kristian F. Høgh wrote:
> > Hi Daniel.
> > 
> > Thanks alot.
> > It fixed the problem at my testbed.
> > In production i reload several htables + address and domain, so I updated 
> > my config.
> > 
> > 16(31430) ALERT: qm_status:1700. N  address=0x7f9bf03905e8 
> > frag=0x7f9bf03905b0 size=64 used=1
> > 16(31430) ALERT: qm_status:   alloc'd from db_mysql: km_res.c: 
> > db_mysql_get_columns(77)
> > 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> > 16(31430) ALERT: qm_status:1701. N  address=0x7f9bf0390690 
> > frag=0x7f9bf0390658 size=64 used=1
> > 16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
> > db_allocate_columns(150)
> > 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> > 16(31430) ALERT: qm_status:1702. N  address=0x7f9bf0390738 
> > frag=0x7f9bf0390700 size=64 used=1
> > 16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
> > db_allocate_columns(160)
> > 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> > 16(31430) ALERT: qm_status:1703. N  address=0x7f9bf03907e0 
> > frag=0x7f9bf03907a8 size=64 used=1
> > 16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
> > db_new_result(114)
> > 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> > 16(31430) ALERT: qm_status:1706. N  address=0x7f9bf0390a58 
> > frag=0x7f9bf0390a20 size=64 used=1
> > 16(31430) ALERT: qm_status:   alloc'd from db_mysql: km_res.c: 
> > db_mysql_new_result(236)
> > 
> > Regards,
> > Kristian.
> > 
> > On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin Mierla wrote:
> > > Hello,
> > > 
> > > can you fetch the master and try again -- I just pushed some fixes.
> > > 
> > > Cheers,
> > > Daniel
> > > 
> > > 
> > > On 28.04.17 08:17, Kristian F. Høgh wrote:
> > > > Hi list,
> > > >
> > > > I use current git master.
> > > > When I reload a htable using "kamcmd htable.reload htable1", the "ctl 
> > > > handler" process leaks 384 bytes of pkg memory
> > > > If I use a direct mysql connection without db_cluster, the is no memory 
> > > > leak
> > > >
> > > > modparam("db_cluster", "connection", 
> > > > "con1=>mysql://user:p...@ip.addr/database")
> > > > modparam("db_cluster", "connection", 
> > > > "con2=>mysql://user:pass@ip.addr2/database")
> > > > modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
> > > >
> > > > modparam("htable", "db_url", "cluster://cls1")
> > > > # modparam("htable", "db_url", "mysql://user:p...@ip.addr/database"
> > > > modparam("htable", "htable", 
> > > > "htable1=>size=8;autoexpire=0;dbtable=htable1;")
> > > >
> > > > 16(10429) ALERT: qm_status:6513. N  address=0x7f4e65e01720 
> > > > frag=0x7f4e65e016e8 size=128 used=1
> > > > 16(10429) ALERT: qm_status:   alloc'd from db_cluster: 
> > > > dbcl_api.c: db_cluster_init(294)
> > > > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > > > c0c0c0c0, abcdefed
> > > > 16(10429) ALERT: qm_status:6514. N  address=0x7f4e65e01808 
> > > > frag=0x7f4e65e017d0 size=128 used=1
> > > > 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> > > > db_do_init2(298)
> > > > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > > > c0c0c0c0, abcdefed
> > > > 16(10429) ALERT: qm_status:6515. N  address=0x7f4e65e018f0 
> > > > frag=0x7f4e65e018b8 size=128 used=1
> > > > 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> > > > db_do_init2(298)
> > > > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > > > c0c0c0c0, abcdefed
> > > >
> > > > Regards,
> > > > Kristian Høgh
> > > > Uni-tel A/S
> > > >
> > > >  
> > > >
> > > > ___
> > > > Kamailio (SER) - Users Mailing List
> > > > sr-users@lists.kamailio.org
> > > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > > 
> > > 
> > 
> > 
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio

Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-04-28 Thread Kristian F . Høgh
Hi,

I did some more testing.

reloading address and domain is fixed in master 
(08f8e0bc72b9f16f76b78110c9c95b1ba7f1ce25)
If I only have one htable, I can reload many times without memory leak. (The 
content i database is unchanged)
If I have 2 htables and keep reloading both, kamailio leaks as below. (The 
content i database is unchanged)

Regards,
Kristian.


On Friday, April 28, 2017 11:20:29 AM CEST Kristian F. Høgh wrote:
> Hi Daniel.
> 
> Thanks alot.
> It fixed the problem at my testbed.
> In production i reload several htables + address and domain, so I updated my 
> config.
> 
> 16(31430) ALERT: qm_status:1700. N  address=0x7f9bf03905e8 
> frag=0x7f9bf03905b0 size=64 used=1
> 16(31430) ALERT: qm_status:   alloc'd from db_mysql: km_res.c: 
> db_mysql_get_columns(77)
> 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
> 16(31430) ALERT: qm_status:1701. N  address=0x7f9bf0390690 
> frag=0x7f9bf0390658 size=64 used=1
> 16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
> db_allocate_columns(150)
> 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
> 16(31430) ALERT: qm_status:1702. N  address=0x7f9bf0390738 
> frag=0x7f9bf0390700 size=64 used=1
> 16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
> db_allocate_columns(160)
> 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
> 16(31430) ALERT: qm_status:1703. N  address=0x7f9bf03907e0 
> frag=0x7f9bf03907a8 size=64 used=1
> 16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
> db_new_result(114)
> 16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
> 16(31430) ALERT: qm_status:1706. N  address=0x7f9bf0390a58 
> frag=0x7f9bf0390a20 size=64 used=1
> 16(31430) ALERT: qm_status:   alloc'd from db_mysql: km_res.c: 
> db_mysql_new_result(236)
> 
> Regards,
> Kristian.
> 
> On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin Mierla wrote:
> > Hello,
> > 
> > can you fetch the master and try again -- I just pushed some fixes.
> > 
> > Cheers,
> > Daniel
> > 
> > 
> > On 28.04.17 08:17, Kristian F. Høgh wrote:
> > > Hi list,
> > >
> > > I use current git master.
> > > When I reload a htable using "kamcmd htable.reload htable1", the "ctl 
> > > handler" process leaks 384 bytes of pkg memory
> > > If I use a direct mysql connection without db_cluster, the is no memory 
> > > leak
> > >
> > > modparam("db_cluster", "connection", 
> > > "con1=>mysql://user:p...@ip.addr/database")
> > > modparam("db_cluster", "connection", 
> > > "con2=>mysql://user:pass@ip.addr2/database")
> > > modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
> > >
> > > modparam("htable", "db_url", "cluster://cls1")
> > > # modparam("htable", "db_url", "mysql://user:p...@ip.addr/database"
> > > modparam("htable", "htable", 
> > > "htable1=>size=8;autoexpire=0;dbtable=htable1;")
> > >
> > > 16(10429) ALERT: qm_status:6513. N  address=0x7f4e65e01720 
> > > frag=0x7f4e65e016e8 size=128 used=1
> > > 16(10429) ALERT: qm_status:   alloc'd from db_cluster: 
> > > dbcl_api.c: db_cluster_init(294)
> > > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > > c0c0c0c0, abcdefed
> > > 16(10429) ALERT: qm_status:6514. N  address=0x7f4e65e01808 
> > > frag=0x7f4e65e017d0 size=128 used=1
> > > 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> > > db_do_init2(298)
> > > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > > c0c0c0c0, abcdefed
> > > 16(10429) ALERT: qm_status:6515. N  address=0x7f4e65e018f0 
> > > frag=0x7f4e65e018b8 size=128 used=1
> > > 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> > > db_do_init2(298)
> > > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > > c0c0c0c0, abcdefed
> > >
> > > Regards,
> > > Kristian Høgh
> > > Uni-tel A/S
> > >
> > >  
> > >
> > > ___
> > > Kamailio (SER) - Users Mailing List
> > > sr-users@lists.kamailio.org
> > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > 
> > 
> 
> 
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-04-28 Thread Kristian F . Høgh
Hi Daniel.

Thanks alot.
It fixed the problem at my testbed.
In production i reload several htables + address and domain, so I updated my 
config.

16(31430) ALERT: qm_status:1700. N  address=0x7f9bf03905e8 
frag=0x7f9bf03905b0 size=64 used=1
16(31430) ALERT: qm_status:   alloc'd from db_mysql: km_res.c: 
db_mysql_get_columns(77)
16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed
16(31430) ALERT: qm_status:1701. N  address=0x7f9bf0390690 
frag=0x7f9bf0390658 size=64 used=1
16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
db_allocate_columns(150)
16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed
16(31430) ALERT: qm_status:1702. N  address=0x7f9bf0390738 
frag=0x7f9bf0390700 size=64 used=1
16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
db_allocate_columns(160)
16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed
16(31430) ALERT: qm_status:1703. N  address=0x7f9bf03907e0 
frag=0x7f9bf03907a8 size=64 used=1
16(31430) ALERT: qm_status:   alloc'd from core: db_res.c: 
db_new_result(114)
16(31430) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed
16(31430) ALERT: qm_status:1706. N  address=0x7f9bf0390a58 
frag=0x7f9bf0390a20 size=64 used=1
16(31430) ALERT: qm_status:   alloc'd from db_mysql: km_res.c: 
db_mysql_new_result(236)

Regards,
Kristian.

On Friday, April 28, 2017 9:38:25 AM CEST Daniel-Constantin Mierla wrote:
> Hello,
> 
> can you fetch the master and try again -- I just pushed some fixes.
> 
> Cheers,
> Daniel
> 
> 
> On 28.04.17 08:17, Kristian F. Høgh wrote:
> > Hi list,
> >
> > I use current git master.
> > When I reload a htable using "kamcmd htable.reload htable1", the "ctl 
> > handler" process leaks 384 bytes of pkg memory
> > If I use a direct mysql connection without db_cluster, the is no memory leak
> >
> > modparam("db_cluster", "connection", 
> > "con1=>mysql://user:p...@ip.addr/database")
> > modparam("db_cluster", "connection", 
> > "con2=>mysql://user:pass@ip.addr2/database")
> > modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
> >
> > modparam("htable", "db_url", "cluster://cls1")
> > # modparam("htable", "db_url", "mysql://user:p...@ip.addr/database"
> > modparam("htable", "htable", 
> > "htable1=>size=8;autoexpire=0;dbtable=htable1;")
> >
> > 16(10429) ALERT: qm_status:6513. N  address=0x7f4e65e01720 
> > frag=0x7f4e65e016e8 size=128 used=1
> > 16(10429) ALERT: qm_status:   alloc'd from db_cluster: dbcl_api.c: 
> > db_cluster_init(294)
> > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> > 16(10429) ALERT: qm_status:6514. N  address=0x7f4e65e01808 
> > frag=0x7f4e65e017d0 size=128 used=1
> > 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> > db_do_init2(298)
> > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> > 16(10429) ALERT: qm_status:6515. N  address=0x7f4e65e018f0 
> > frag=0x7f4e65e018b8 size=128 used=1
> > 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> > db_do_init2(298)
> > 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> > c0c0c0c0, abcdefed
> >
> > Regards,
> > Kristian Høgh
> > Uni-tel A/S
> >
> >  
> >
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> 


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Memory leak when reloading htable using db_cluster

2017-04-28 Thread Daniel-Constantin Mierla
Hello,

can you fetch the master and try again -- I just pushed some fixes.

Cheers,
Daniel


On 28.04.17 08:17, Kristian F. Høgh wrote:
> Hi list,
>
> I use current git master.
> When I reload a htable using "kamcmd htable.reload htable1", the "ctl 
> handler" process leaks 384 bytes of pkg memory
> If I use a direct mysql connection without db_cluster, the is no memory leak
>
> modparam("db_cluster", "connection", 
> "con1=>mysql://user:p...@ip.addr/database")
> modparam("db_cluster", "connection", 
> "con2=>mysql://user:pass@ip.addr2/database")
> modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
>
> modparam("htable", "db_url", "cluster://cls1")
> # modparam("htable", "db_url", "mysql://user:p...@ip.addr/database"
> modparam("htable", "htable", "htable1=>size=8;autoexpire=0;dbtable=htable1;")
>
> 16(10429) ALERT: qm_status:6513. N  address=0x7f4e65e01720 
> frag=0x7f4e65e016e8 size=128 used=1
> 16(10429) ALERT: qm_status:   alloc'd from db_cluster: dbcl_api.c: 
> db_cluster_init(294)
> 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
> 16(10429) ALERT: qm_status:6514. N  address=0x7f4e65e01808 
> frag=0x7f4e65e017d0 size=128 used=1
> 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> db_do_init2(298)
> 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
> 16(10429) ALERT: qm_status:6515. N  address=0x7f4e65e018f0 
> frag=0x7f4e65e018b8 size=128 used=1
> 16(10429) ALERT: qm_status:   alloc'd from core: db.c: 
> db_do_init2(298)
> 16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= 
> c0c0c0c0, abcdefed
>
> Regards,
> Kristian Høgh
> Uni-tel A/S
>
>  
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@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 - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Memory leak when reloading htable using db_cluster

2017-04-27 Thread Kristian F . Høgh
Hi list,

I use current git master.
When I reload a htable using "kamcmd htable.reload htable1", the "ctl handler" 
process leaks 384 bytes of pkg memory
If I use a direct mysql connection without db_cluster, the is no memory leak

modparam("db_cluster", "connection", "con1=>mysql://user:p...@ip.addr/database")
modparam("db_cluster", "connection", 
"con2=>mysql://user:pass@ip.addr2/database")
modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")

modparam("htable", "db_url", "cluster://cls1")
# modparam("htable", "db_url", "mysql://user:p...@ip.addr/database"
modparam("htable", "htable", "htable1=>size=8;autoexpire=0;dbtable=htable1;")

16(10429) ALERT: qm_status:6513. N  address=0x7f4e65e01720 
frag=0x7f4e65e016e8 size=128 used=1
16(10429) ALERT: qm_status:   alloc'd from db_cluster: dbcl_api.c: 
db_cluster_init(294)
16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed
16(10429) ALERT: qm_status:6514. N  address=0x7f4e65e01808 
frag=0x7f4e65e017d0 size=128 used=1
16(10429) ALERT: qm_status:   alloc'd from core: db.c: db_do_init2(298)
16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed
16(10429) ALERT: qm_status:6515. N  address=0x7f4e65e018f0 
frag=0x7f4e65e018b8 size=128 used=1
16(10429) ALERT: qm_status:   alloc'd from core: db.c: db_do_init2(298)
16(10429) ALERT: qm_status:  start check=f0f0f0f0, end check= c0c0c0c0, 
abcdefed

Regards,
Kristian Høgh
Uni-tel A/S

 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users