I\'m running into an interesting problem. I\'m using PHPUnit, and my tests take more memory every single time I run them. Ie...
2.25 MB
2.5 MB
3.0 MB
The technical details behind PHPUnit's garbage collection have already been covered by @edorian and @mauris, but I wanted to add that PHPUnit (at least in version 3.7.21, which I'm running) gives you the ability to add the comment:
/**
* @backupGlobals disabled
*/
class MyClassTests extends PHPUnit_Framework_TestCase{}
Before adding the annotation, I was roughly doubling my memory usage on each run of my test suite, the last one hitting about 1100 MB. Now they're running at 15 MB.