<div dir="auto">I had a similar issue. The problem is the vtiger API call, they add 8mb circa at each call.<div dir="auto"><br></div><div dir="auto">The solution for me was process before in batch of 5k (this is the max it could process without existing in my case, try fine tune it), then dump the batch to a JSON. After processing I created a stupid script that reads the JSON and executes. I've serialised it, the main script launched multiple instances of executor script in parallel. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Another approach we took was pentaho data integration with which we called the crm's API (custom) while all the data fetch and processing was done on pentaho. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il ven 23 ott 2020, 05:43 Rubén A. Estrada Orozco <<a href="mailto:rulotec1@gmail.com">rulotec1@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>So I have a script that does something like this:</div><div><br></div><div><div><img src="cid:ii_kglonuwr0" alt="image.png" style="margin-right:25px"><br></div></div><div><div>It gets data from an sql server database and updates accounts' fields in vtiger.</div><div>It's a greatly simplified version, but the essence is that of the above code.</div><div><br></div><div>I execute if from the command line. But after some time, I get an "Allowed memory size of 92274688 bytes exhausted"</div><div>In this example I use only 5000 records instead of the actual ~32k I need to update. And I lowered PHP's memory_limit to 88MB from 1GB to be able to get to the error quickly.</div><div><br></div><div>What you can see in the following screenshots is that memory usage keeps increasing until all available memory is exhausted. Why would that happen? I thought it should remain constant. It's as if PearDatabase was eating up the memory.</div><div><br></div><div><div><img src="cid:ii_kglosu1z1" alt="image.png" width="562" height="331"><br></div></div><div><br></div><div><div><img src="cid:ii_kglouw9d2" alt="image.png" width="562" height="230"><br></div></div><div><br></div><div>This is supposed to run a few times a day and it needs to be efficient.</div><div><br></div><div>Any thoughts?</div><div><br clear="all"><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr">Saludos<div><br></div><div>Rubén</div></div></div></div></div></div></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>