<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 14px;" lang="x-western">I have a CentOS 6 installation
with the following packages installed from the RPM build service
from Kamailio:
<br>
<br>
kamailio-unixodbc-4.1.2-1.1.x86_64
<br>
kamailio-4.1.2-1.1.x86_64
<br>
kamailio-presence-4.1.2-1.1.x86_64
<br>
kamailio-utils-4.1.2-1.1.x86_64
<br>
<br>
I am also using db_unixodbc for all database accesses (with MySQL
backend). The problem is that after a few hours, a single Kamailio
process (never more than one) starts complaining that it has run
out of memory:
<br>
<br>
9(11479) ERROR: uac [uac_reg.c:638]: uac_reg_tm_callback(): got
sip response 408 while registering [admin_pbx.elastix.com]
<br>
9(11479) ERROR: db_unixodbc [dbase.c:335]:
db_unixodbc_fetch_result(): no memory left
<br>
9(11479) ERROR: <core> [db_query.c:502]: db_fetch_next():
unable to fetch next rows
<br>
9(11479) ERROR: db_unixodbc [dbase.c:224]:
db_unixodbc_free_result(): invalid parameter value
<br>
9(11479) ERROR: db_unixodbc [dbase.c:327]:
db_unixodbc_fetch_result(): no private memory left
<br>
9(11479) ERROR: <core> [db_query.c:434]:
db_fetch_query_internal(): unable to fetch the db result
<br>
9(11479) ERROR: presence [publish.c:108]: msg_presentity_clean():
failed to query database for expired messages
<br>
9(11479) ERROR: db_unixodbc [dbase.c:327]:
db_unixodbc_fetch_result(): no private memory left
<br>
9(11479) ERROR: <core> [db_query.c:434]:
db_fetch_query_internal(): unable to fetch the db result
<br>
9(11479) ERROR: presence [publish.c:108]: msg_presentity_clean():
failed to query database for expired messages
<br>
9(11479) ERROR: db_unixodbc [dbase.c:327]:
db_unixodbc_fetch_result(): no private memory left
<br>
9(11479) ERROR: <core> [db_query.c:434]:
db_fetch_query_internal(): unable to fetch the db result
<br>
<br>
I have attached the stderr output when I kill the offending
process. From what I can see, the memory leak somehow involves
database allocations that fail to be freed, consuming more than 3
MB out of 4 MB allocated:
<br>
<br>
9(11479) NOTICE: <core> [main.c:857]: sig_usr(): Memory
still-in-use summary (pkg):
<br>
9(11479) NOTICE: qm_sums: summarizing all alloc'ed. fragments:
<br>
9(11479) NOTICE: qm_sums: count= 1 size= 10240 bytes
from mi_fifo: mi_writer.c: mi_writer_init(57)
<br>
9(11479) NOTICE: qm_sums: count= 378 size= 3029384 bytes
from db_unixodbc: dbase.c: db_unixodbc_fetch_result(333)
<br>
9(11479) NOTICE: qm_sums: count= 1 size= 4096 bytes
from db_unixodbc: dbase.c: db_unixodbc_fetch_result(325)
<br>
9(11479) NOTICE: qm_sums: count= 1 size= 16 bytes
from <core>: sr_module.c: init_modules(1002)
<br>
9(11479) NOTICE: qm_sums: count= 1 size= 56 bytes
from textops: textops.c: hname_fixup(1634)
<br>
9(11479) NOTICE: qm_sums: count= 1 size= 32 bytes
from rr: rr_cb.c: register_rrcb(63)
<br>
<br>
I have the setup to compile my own RPMS, and I intend to track
down the memory leak on my own. However, I would like your help in
focusing my search, on whether this is a known issue, or where in
db_unixodbc should I look.
<br>
</div>
</body>
</html>