Forums / Developer / How to build an update CLI script without memory problem ? / Comment51108
Bartek Modzelewski
Monday 01 June 2009 12:42:06 pm
Hi,
I'm not specialist of this, but I think, that just PHP is not perfect and memory leak happens very offen. I was working on many huge imports and this problem was always comming back. I rememer in one of projects, that setting even 1GB as memory limit did not help in daily data import and stoped script loop after updating about 2200 objects.
Same problem are having other php applications. Although I saw last time very interesting solution in Magento webshop: Product import was launched by ajax, so that each product was imported in single script execution. Import was slow and caused that browser was blocked for some time, but has eliminated memory lack problem.
Other solution used in Exponential, was a cli script, that breaks process/import after for ex. each 1000 objects and continue with next execution. This needs some additional work, but for dedicated imports can be very usefull (irreplaceable).
Baobaz http://www.baobaz.com