Reputation: 1733
I have the problem that my unit tests for some assertions and mocks are running out of memory. The memory is increasing each second 100MB and then killing the phpunit process when it's reaching the maximum available memory.
I would expect that the test is failing with some helpful message but because it's just killing the process I don't really know how to debug it.
Any idea why or how to debug the behaviour?
Upvotes: 2
Views: 1749
Reputation: 2708
I have had problems with running out of memory before. On thing I found helpful was to turn off the garbage collection with the tests.
$ phpunit -d zend.enable_gc=0
As for debugging, try
$ phpunit --debug
to figure out which test is causing the problem. From here, you need to debug, the same way you would any bug.
Upvotes: 5