<div><div>Hi all</div><div><br></div><div>we are running kamailio 3.1.1. Basically for every call it has to query a mtree that is reloaded every 15 minutes. The mtree table is about 4M records and  is stored in a Pgostgres database. For the reload we use the command mi mt_reload embedded in a xmlrpc request. The code for this is:</div>
<div><div>route[XMLRPC]{</div><div>        if (method == &quot;POST&quot; || method == &quot;GET&quot;) </div><div>        {</div><div>                if (search(&quot;^User-Agent:&quot;))</div><div>                {</div>
<div>                        xlog(&quot;xmlrpc request\n&quot;);</div><div>                        set_reply_close();</div><div>                        set_reply_no_connect(); # optional</div><div>                        dispatch_rpc();</div>
<div>                }</div><div>                exit;</div><div>        }</div><div>}</div></div><div>This server has been running with no issued for some weeks now, but at some point during the weekend the mi command started to fail. This is what the logs show:</div>
<div><br></div><div>ERROR: &lt;core&gt; [db_res.c:181]: no private memory left</div><div>ERROR: db_postgres [km_res.c:225]: could not allocate rows</div><div>ERROR: db_postgres [km_dbase.c:280]: failed to convert rows</div>
<div>ERROR: mtree [mtree_mod.c:627]: Error while fetching result</div><div>ERROR: db_postgres [km_dbase.c:318]: invalid parameter value</div><div>ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database</div></div>
<div><br></div><div>I&#39;ve restarted kamailio and now it&#39;s working fine. Should we increase the private memory? On the other hand, we&#39;d like to detect this failure condition on the script and act accordingly (for instance sending an email with an alarm message), is there anyway to do this?</div>
<div><br></div><div>Thanks in advance</div><div><br></div><div>Regards</div><div><br></div><div>Javier</div>