<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">Hello</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">We've put Kamailio on a machine with a SIP-Proxy role, we replaced another SIP proxy implementation.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">We started with the default 4Mb of PKG Memory and 1024 Mb of Shared Memory but we had messages like these in the logs:</div><div
 style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:26,939  ERROR: app_perl [kamailioxs.xs:371]: pv_sprintf(): pv_sprintf: Memory exhausted!</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:50,267  ERROR: app_perl [kamailioxs.xs:371]: pv_sprintf(): pv_sprintf: Memory exhausted!</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,822  ERROR: <core> [data_lump.c:197]: insert_subst_lump_after(): ERROR: insert_new_lump_after: out of memory</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR:
 <core> [parser/contact/contact.c:194]: parse_contacts(): parse_contacts(): No memory left</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR: memcached [../../parser/../ut.h:736]: pkg_str_dup(): could not allocate private memory from available pool</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR: <core> [data_lump.c:373]: anchor_lump(): ERROR: anchor_lump: out of memory</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR: <core> [dset.c:525]: rewrite_uri(): No memory left to rewrite r-uri</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR: <core> [action.c:810]:
 do_action(): ERROR: do_action: memory allocation  failure</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR: <core> [msg_translator.c:2164]: build_res_buf_from_sip_req(): ERROR: build_res_buf_from_sip_req: out of memory  ; needs 357</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">2013-09-26 13:48:51,823  ERROR: <core> [msg_translator.c:2164]: build_res_buf_from_sip_req(): ERROR: build_res_buf_from_sip_req: out of memory  ; needs 376</font></div><div><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">Then we started
 kamailio like below, with 1024Mb of private memory (per process) :</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2">/opt/kamailio/sbin/kamailio -f /opt/kamailio/etc/kamailio//kamailio.cfg -w /opt/kamailio/core_dir/corefiles -P /opt/kamailio/var/run//kamailio.pid -m 1024 -M 1024 -u kamailio -g kamailio</font><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'Times New Roman'; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">Then after about 4 days we realized that we
 have a steady increase of used memory ( in the output of free command the '-/+ buffers/cache:' row  ), and we simply restarted the kamailio process.</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">The machine has 12 Gb of RAM , we run with children=32 .  1gb of memory per process x 32 child processes means that we are over the physical capacity of the machine.</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">The
 question is , are we in any danger of running out of memory on this box where we only run kamailio ? We don't want to reach the point where the kernel starts killing processes.</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">Shall we suspect some memory leak in the app_perl module ? (we do some http queries over SSL from a perl script)</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color:
 transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">Thank you.</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">Regards,</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">Dragos Oancea</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif;
 font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div></div></body></html>