Php/Symfony/Doctrine Memory Leak

Memory leak when executing Doctrine query in loop

I resolved this by adding --no-debug to my command. It turns out that in debug mode, the profiler was storing information about every single query in memory.

Memory leak in PHP with Symfony + Doctrine

I solved my problems with Doctrine memory leaks by freeing and unseting data, did you try it?

// ...
$data->free(true) ;
unset($data) ;
// ...

Symfony 5, memory leaking when send multiple emails through mailer

The problem was fixed in Symfony 5.2.
Here is details of bug: https://github.com/symfony/symfony/pull/37712

So to all who have same problem, upgrade your symfony.

Symfony and PhpUnit memory leak

The full solution as been found here:
https://github.com/symfony/symfony/issues/18236

For each service used in the phpunit test, you have to free it by assigning null to the variable if you want the garbage collector to free memory.

protected function tearDown()
{
parent::tearDown();

$this->em->close();

$this->em=null;

gc_collect_cycles();
}

Memory leak symfony and monolog and console

Found the solution. I can't tell you the exact reasons why such memory leak happen, however according to this; Adding the --no-debug option to your command solves the problem. It actually did and it even reduced the memory by 2mb. Cheers !



Related Topics



Leave a reply



Submit