alexmansour's avatar

Allowed memory size exhausted when I run my test suites

Today I just started to get Fatal error: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 65488 bytes) when I run my test suites, after the fifth test I'm getting this fatal error.

I have tried to increase the memory_limit with no luck.

Fatal error: Uncaught exception 'Illuminate\Contracts\Container\BindingResolutionException' with message 'Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable.' in \laravel\framework\src\Illuminate\Container\Container.php:744 Stack trace: #0 laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build('Illuminate\Cont...', Array) #1 laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('Illuminate\Cont...', Array) #2 vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(154): Illuminate\Foundation\Application->make('Illuminate\Cont...')

#3 \laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(79): Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionH a in laravel\framework\src\Illuminate\Container\Container.php on line 744

Laravel version is: 5.1

Anybody, can help with this issue, thanks in advance.

0 likes
2 replies
bobbybouwmann's avatar

This seems to be a lot... Are you sure you are not in an infinite loop or something? Can you show your code and the test?

alexmansour's avatar

Thanks for your reply.

I went through the latest implementation I have done, and I just found that I'm initializing a Helper Class into another, where in this second class I'm initializing the first class.

For example:

Class A:

private $classB;

public function __construct(ClassB $classB) { $this->classB= $classB; }

Class B:

private $classA;

public function __construct(ClassA $classA) { $this->classA= $classA; }

So the cause happens when I was using any helper method from Class A.

Anyway, thank you for your hint.

Please or to participate in this conversation.