I'm having a lot of trouble with llops. PHP for some reason don't clear memeory between iterations. The scenario is this i'm traversing a order collection, loads a order, do some stuff with the order object and then the next order. So whats happening, that lets say the order object is of 2 mb, so what's happening the PHP maintains that 2 mb for few iterations but after few iterations it adds 2 more mb into it, making it 4 and so on. So after few thounsands iterations the memory being used is in GBs and it runs out of memory. I don't understand this behaviour. Can someone please help me out with this issue
Add following lines into index.php of root folder of magento and try.
ini_set('memory_limit','-1'); ini_set('max_execution_time', 0);
For Magento2 you should have memory_limit 4096M. Please check with server.
Run following commands:
php bin/Magento cache:flush php bin/magento indexer:reindex
making it 4 and so on. So after few thounsands iterations the memory being used is in GBs and it runs out o word to pdf f memory. I don't understand thi snaptube s behaviour. vidmate Can someone please help me out with this issue