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:
- Using a phpunit plugin
- Using lime
- Restricting the tests to a few sfPropelData loads + functional tests repeated a few times
- Switching to PHP 5.3.3 to handle circular references
- Inspecting memory usage xdebug which didn't give much insight
Soon we'll be trying:
- Only the functional tests
- Replacing sfPropelData instead loading plain SQL files
- Only functional tests without any ORM calls
- Valgrind?
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?
Thanks