[OpenSIPS-Users] Possible memory leak in PKG

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Nov 14 15:24:24 UTC 2022


Hi all,

As a quick update, thanks to Arto's help and troubleshooting, a mem leak 
was indeed identified.

The fix is now available on all versions.

https://github.com/OpenSIPS/opensips/commit/f07e90aac92f33d3321d73ed69ca19850b7e10b4

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp 5-16 Dec 2022, online
   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/

On 10/10/22 4:55 PM, Arto Kuiri wrote:
> Hi,
>
> Yes, that is where memory leak seams to be. This happens in all SIP 
> udp receiver processes.
>
> I can provide logs and config etc offlist.
>
> -Arto
> ------------------------------------------------------------------------
> *Lähettäjä:* Bogdan-Andrei Iancu <bogdan at opensips.org>
> *Lähetetty:* maanantai 10. lokakuuta 2022 16.33
> *Vastaanottaja:* OpenSIPS users mailling list 
> <users at lists.opensips.org>; Arto Kuiri <art666 at hotmail.com>
> *Aihe:* Re: [OpenSIPS-Users] Possible memory leak in PKG
> Hi Arto,
>
> Thanks for the report here. So, the 3.2.7 suffers of a mem leak which 
> DOES NOT exist in 3.1.1, mainly this
>
>       109600 : 4858 x [dlg_vals.c: fetch_dlg_value, line 176]
>
> right ?
>
> Best regards,
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>    https://www.opensips-solutions.com  <https://www.opensips-solutions.com>
> OpenSIPS Summit 27-30 Sept 2022, Athens
>    https://www.opensips.org/events/Summit-2022Athens/  <https://www.opensips.org/events/Summit-2022Athens/>
> On 10/5/22 10:16 AM, Arto Kuiri wrote:
>> Hi,
>>
>> I think I have stumbled to some kind of memory leak. I made new 
>> opensips server used same opensips.cfg (changed only ip address) as 
>> in my older servers and after some time I started to get these to log 
>> file:
>>
>> /usr/sbin/opensips[1145854]: ERROR:core:fm_malloc: not enough free 
>> pkg memory (2312 bytes left, need 2472), please increase the "-M" 
>> command line parameter!
>> /usr/sbin/opensips[1145854]: ERROR:core:receive_msg: no pkg mem left 
>> for sip_msg
>>
>> Older servers works fine with much higher load. Old servers are with 
>> opensips 3.1.1 and new server is 3.2.7 :
>>
>> opensips -V
>> version: opensips 3.1.1 (x86_64/linux)
>> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, 
>> Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
>> MAX_URI_SIZE 1024, BUF_SIZE 65535
>> poll method support: poll, epoll, sigio_rt, select.
>> main.c compiled on  with gcc 9
>>
>> opensips -V
>> version: opensips 3.2.7 (x86_64/linux)
>> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, 
>> Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
>> MAX_URI_SIZE 1024, BUF_SIZE 65535
>> poll method support: poll, epoll, sigio_rt, select.
>> main.c compiled on  with gcc 11
>>
>> I allocated more memory and changed private memory allocator to 
>> F_MALLOC_DBG
>>
>> After while I checked what process had highest memory useage and I did:
>> opensips-cli -x mi mem_pkg_dump <pid>
>> (PID was "SIP receiver udp")
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20221114/6e385c37/attachment.html>


More information about the Users mailing list