How to use less memory while running a task in Symfony 1.4?
- by Guillaume Flandre
I'm using Symfony 1.4 and Doctrine.
So far I had no problem running tasks with Symfony.
But now that I have to import a pretty big amount of data and save them in the database, I get the infamous
"Fatal Error: Allowed memory size of
XXXX bytes exhausted"
During this import I'm only creating new objects, setting a few fields and saving them.
I'm pretty sure it has something to do with the number of objects I'm creating when saving data. Unsetting those objects doesn't do anything though.
Are there any best practices to limit memory usage in Symfony?