How to use less memory while running a task in Symfony 1.4?

Posted by Guillaume Flandre on Stack Overflow See other posts from Stack Overflow or by Guillaume Flandre
Published on 2010-03-17T15:05:43Z Indexed on 2010/04/24 8:53 UTC
Read the original article Hit count: 308

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about symfony

Related posts about symfony-1.4