[SR-Users] Passive Open TCP sessions increases and kamailio runs out of memory

Niklas Larsson niklas at tese.se
Mon Sep 11 18:43:47 CEST 2017


Hi,

I have a kamailio 4.4.5 (x86_64/linux), running as a proxy in front of 
asterisk, handling udp/tcp/tls registration, using udp towards asterisk.

Over time memory is consumed and the Passive Open TCP sessions is 
increasing until we run out of memory and a restart is needed.

Sep 11 06:25:03  ERROR: <core> [mem/f_malloc.c:415]: fm_search_defrag(): 
fm_search_defrag(0x7f9d55184000, 34120); Free fragment not found!
Sep 11 06:25:03  ERROR: <core> [mem/f_malloc.c:498]: fm_malloc(): 
fm_malloc(0x7f9d55184000, 34120) called from tls: tls_init.c: 
ser_malloc(275), module: tls; Free fragment not found!

This image contains graphs that show the behaviour: 
https://imgur.com/68PvmyA

Should it behave like this?

Is there a knob to twist to change behaviour?

tcp / tls stuff from kamailio.cfg:

enable_tls=yes
tcp_max_connections=8196
tls_max_connections=8196
tcp_no_connect=yes # Don't try to connect - drop if there is no session
tcp_connection_lifetime=3605

modparam("tcpops", "closed_event", 1)

modparam("usrloc", "handle_lost_tcp", 1)
modparam("usrloc", "close_expired_tcp", 1)

in the registrar route I have:
tcp_keepalive_enable("60", "5", "5");

/niklas



More information about the sr-users mailing list