We're currently having issues with memory leaks when using unit tests with Symfony 1.x to the magnitude of a decent number of tests eating 512MB of memory.
Currently we've tried:
Soon we'll be trying:
I'm thinking maybe the static variables within symfony aren't getting cleaned up or the PDO layer is itself leaking memory. Of course, the last option is to figure out a way to run a suite of tests in its own process.
We're progressing through the areas it could be in and I don't expect anyone to actually help us work out the details but I'm just throwing this question out there to see if anyone has experienced this and where they found the leak to be or what they did to get around this.
Also, any input on other tools that can assist, like valgrind?
Only functional tests without any ORM calls
That is one that I always try to prevent: Use Mock-Objects instead of accessing the database.
What you can try is the new PHPUnit-Version that has process isolation of the tests (activated via additional command line parameter). That should help you. It is slower but helps with the memory problem