We are using the t_uac_dlg function through a UDP MI Datagram to create local SIP/TCP requests. We are seeing a memory leak of increasing shared Memory usage, which is increasing at the same rate as tcp connections are created (tested under 4.0.1 and 4.3.1).
/usr/sbin/kamailio[25407]: NOTICE: fm_status: count= 71943 size= 14126536 bytes from mi_datagram: datagram_fnc.c: build_async_handler(387)
After looking at the memory dump and investigating the source, I guess that the memory leak is created, when the
MI_ASYNC_RPL_FLAG
is set. This seems to be set by:
modules/tmx/tmx_mod.c: {MI_TM_UAC, mi_tm_uac_dlg, MI_ASYNC_RPL_FLAG, 0, 0 },
only, which we are using heavily.
Can someone please give me a hint, where to search for the memory leak. My guess is that:
modules/mi_datagram/datagram_fnc.c:489
if (f->flags&MI_ASYNC_RPL_FLAG) { hdl = build_async_handler(mi_socket_domain, (struct sockaddr* )&reply_addr, reply_addr_len);
the handler is not correctly freed up in the async reply case.
Thank you!
Greetings
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/298
I just pushed a patch to master branch 374bfb1c467d6bf2a4cc143d22868c37143783bd -- can you test and see if solves the leak? If does, I will backport.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/298#issuecomment-134599902
Yes, I will try it out. We suspected the same location already. Thanks!
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/298#issuecomment-134614409
Memory is solved by the patch. Thank you!
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/298#issuecomment-134950611
Thanks for reporting back!
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/298#issuecomment-134951599
Closed #298.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/298#event-392726618