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

Daniel-Constantin Mierla miconda at gmail.com
Tue May 2 09:14:45 CEST 2017


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:pass@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:pass@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 at lists.kamailio.org
>
> > > > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> > > >
>
> > > >
>
> > >
>
> > >
>
> > > _______________________________________________
>
> > > Kamailio (SER) - Users Mailing List
>
> > > sr-users at lists.kamailio.org
>
> > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> >
>
> > _______________________________________________
>
> > Kamailio (SER) - Users Mailing List
>
> > sr-users at lists.kamailio.org
>
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> >
>
>  
>
> -- 
>
> Kristian Høgh
>
>  
>
>  
>
> Telefon: 4422 8822
>
> support at uni-tel.dk <mailto:support at uni-tel.dk>
>
>  
>
> Gydevang 19 | 3450 Allerød
>
> www.uni-tel.dk <http://www.uni-tel.dk>
>
> _______________________________________________
> 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 - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170502/b70542c9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 11620 bytes
Desc: not available
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170502/b70542c9/attachment-0001.png>


More information about the sr-users mailing list