<div dir="ltr">Hi Ruben,<div><br></div><div>Thanks! for reporting the issue on code.</div><div><br></div><div>I will review this discussion on memory leak with batch update.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 12, 2021 at 10:24 PM Rubén A. Estrada Orozco <<a href="mailto:rulotec1@gmail.com">rulotec1@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I've opened the issue Uma: <a href="https://code.vtiger.com/vtiger/vtigercrm/issues/1572" target="_blank">https://code.vtiger.com/vtiger/vtigercrm/issues/1572</a><div>However, now that I think about it, I'm not sure if a memory exhaustion error can be notified. I think that kind of error would cause an immediate crash.</div><div><br></div><div>On the other hand, I don't think the db problem is just a matter of inefficiency in the sense that more memory is used than necessary per query. I think there is a memory leak issue. Please refer to this discussion: <a href="http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-batch-update-task-eats-up-memory-td23640.html" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-batch-update-task-eats-up-memory-td23640.html</a> where a batch update using vtws library causes memory to gradually increase up to exhaustion.</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr">Saludos<div><br></div><div>Rubén</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021 at 6:55 AM Uma S <<a href="mailto:uma.s@vtiger.com" target="_blank">uma.s@vtiger.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>In my opinion on this scenario, I would agree with Mohan's point with PearDB data fetch.</div><div><br></div><div>>>I think the issue is with PearDB and Create/Update API as (if I recall correctly) at each new call of the api it would add 8+ mb..</div><div><br></div><div>Yes! this could be related to the result set fetch through PearDatabase. Where each data retrieved will be having 2 keys in the result,</div><div>one is an integer and the other is a column name key. Which can consume more RAM when more data is retrieved in a single request.</div><div><br></div><div>example:</div><div>[fields] => Array<br>        (<br>            [0] =><br>            [firstname] =><br>            [1] => test again lead<br>            [lastname] => test again lead<br>            [2] =><br>            [title] =><br>            [3] => 0<br>            [accountid] => 0<br>            [4] =><br>            [email] =><br>            [5] =><br>            [phone] =><br>            [6] => 1<br>            [smownerid] => 1<br>            [7] => 6<br>            [contactid] => 6<br>            [8] => 0<br>            [starred] => 0<br>        )<br></div><div><br></div><div>Solution would be to find a way to fetch data with a one format, Either integer or column name.</div><div><br></div><div>We will be reviewing this further to come up with a solution, which adds value to performance.</div><div><br></div><div>>>Also, it would be a good idea to send an email to the admin user upon vtigercron.php execution failure.</div><div>Ruben, we will review with this memory exhausted error to notify the user on cron job. Please do file an issue on same.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021 at 2:38 PM Alan Lord <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 05/02/2021 08:50, Sukhdev Mohan wrote:<br>
> Increasing memory doesn’t solve at all, already tried it, at least in my <br>
> case didn’t solve had to divide and rule hopefully it has to be done <br>
> once in a while). I think the issue is with PearDB and Create/Update API <br>
> as (if I recall correctly) at each new call of the api it would add 8+ <br>
> mb.. I can test this weekend and share more info. If you have any <br>
> insight or experiences please do tell.<br>
<br>
Because I haven't had this particular problem before I have no <br>
experience of it to share.<br>
<br>
There have been occasions however, where I have found I needed to <br>
increase RAM or switch to a cli sapi (no RAM limit) when doing mass <br>
record import or whatnot - but I am talking hundreds of thousands or <br>
millions of records. And generally this was more down to <br>
capacity/performance limitations of the h/w. Writing a shell script and <br>
iterating over the task using smaller blocks has also been a solution <br>
for me. But in Rubén's case this is not possible as it is a scheduled <br>
workflow.<br>
<br>
<br>
Al<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>