Symfony, propel and long running scripts

For long running scripts in symfony with propel ORM you may experience problems with memory usage. To avoid them make sure to disable propel instance caching by calling this code at the beginning of the script:

Propel::disableInstancePooling();

Propel by default caches in memory all fetched database objects. That means that for scripts with extensive db usage or long running time you may hit php memory_limit sooner or later.
Starting with propel 1.3 shipped with symfony 1.3 and 1.4 which are about to be released you’ll be able to disable instance pooling in database yaml config.

Saturday, November 28th, 2009