I use symfony 1.4 (from a task) and Doctrine 1.2 to import data from a lot of files.
It works well, but after a few minutes I get an "Allowed memory size exhausted" fatal error from PHP, not in my code but in Doctrine…
Call Stack:
0.0004 325216 1. {main}() C:\wamp\www\XPower\symfony:0
0.0125 587704 2. include('C:\wamp\www\XPower\lib\vendor\symfony\lib\command\cli.php') C:\wamp\www\XPower\symfony:14
1.9202 6981872 3. sfSymfonyCommandApplication->run() C:\wamp\www\XPower\lib\vendor\symfony\lib\command\cli.php:20
1.9233 6983528 4. sfTask->runFromCLI() C:\wamp\www\XPower\lib\vendor\symfony\lib\command\sfSymfonyCommandApplication.class.php:76
1.9234 6983688 5. sfBaseTask->doRun() C:\wamp\www\XPower\lib\vendor\symfony\lib\task\sfTask.class.php:97
3.0794 7047088 6. dataImportTask->execute() C:\wamp\www\XPower\lib\vendor\symfony\lib\task\sfBaseTask.class.php:68
3.2731 8663752 7. dataImportTask->traiterDossier() C:\wamp\www\XPower\lib\task\dataImportTask.class.php:36
7.7762 17906824 8. dataImportTask->traiterDossier() C:\wamp\www\XPower\lib\task\dataImportTask.class.php:55
264.4390 133557080 9. xPower::importerXml() C:\wamp\www\XPower\lib\task\dataImportTask.class.php:64
264.5919 133609328 10. xPower::importerFichierXml() C:\wamp\www\XPower\lib\XPower.class.php:312
265.4313 134048568 11. InverterTable->findOneBySerialNumber() C:\wamp\www\XPower\lib\XPower.class.php:445
265.4313 134048776 12. Doctrine_Table->__call() C:\wamp\www\XPower\lib\XPower.class.php:445
i've tried adding some "->free()" to Doctrine calls, but now it seems to fail on InverterTable->findOneBySerialNumber()
, a "magic" Doctrine method.
How can I fix my problem ? Do I need to write my own "findOneBySerialNumber" method, adding a call to "free()" ?