Skip to content

Symfony memory leak on windows #21753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cirovargas opened this issue Feb 24, 2017 · 14 comments
Closed

Symfony memory leak on windows #21753

cirovargas opened this issue Feb 24, 2017 · 14 comments

Comments

@cirovargas
Copy link

cirovargas commented Feb 24, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.1.9

I am facing problems with symfony on Windows (Windows Server 2012 R2 Datacenter Edition)

Every day (sometimes more than once a day) the system stop to work because of memory problems:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)

Symfony is not reading the cache data but reloading the src to each request (the cache folder growing up to 10GB)

The PHP version is 7.0.6 x86, Apache 2.4 MPM WinNT

Restarting the service solves my problem but i believe this solution is not appropriate

@stof
Copy link
Member

stof commented Feb 24, 2017

which folder is growing that large inside the cache ? Are you able to determine it ?

@javiereguiluz
Copy link
Member

I don't know if this is the case, but the directory used by the HTTP cache is usually the one that grows indefinitely. See #4871 for related issues and PR attempts.

@cirovargas
Copy link
Author

cirovargas commented Feb 24, 2017

@stof i cleared the cache now, can reply you later. @javiereguiluz is not my case, dont use http cache (use render_esi to render blocks but not cache http properly)

No doctrine cache.

This is a large system (253 tables 23 proprietary bundles) but is used by few users (around 300) and few external daily accesses.

It's worrying me because soon you will have a lot of external access

@javiereguiluz
Copy link
Member

@cirovargas did you manage to investigate more details about this issue? (such as the folder/s that grow the most)

@cirovargas
Copy link
Author

cirovargas commented Mar 8, 2017

twig and annotation. if ia modify a template, class or configuration the symfony ever reload.

This happens on any windows/apache machine.

Permissions on this folders is granted for 'All' read/write and full control

@cirovargas
Copy link
Author

Some logs:

[2016-10-08 15:29:54] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\OutOfMemoryException: "Error: Out of memory (allocated 2097152) (tried to allocate 32768 bytes)" at C:\app\apache_php\apache2\htdocs\ouvidoria\var\cache\prod\twig\e6\e60d73545b68ff8dd395d7b0f7ba16aa49cb4ac30765667898e7aa0f0027347d.php line 60 {"exception":"[object] (Symfony\Component\Debug\Exception\OutOfMemoryException(code: 0): Error: Out of memory (allocated 2097152) (tried to allocate 32768 bytes) at C:\app\apache_php\apache2\htdocs\ouvidoria\var\cache\prod\twig\e6\e60d73545b68ff8dd395d7b0f7ba16aa49cb4ac30765667898e7aa0f0027347d.php:60)"} []

[2016-10-08 15:29:55] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\OutOfMemoryException: "Error: Out of memory (allocated 2097152) (tried to allocate 397312 bytes)" at C:\app\apache_php\apache2\htdocs\ouvidoria\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php line 91 {"exception":"[object] (Symfony\Component\Debug\Exception\OutOfMemoryException(code: 0): Error: Out of memory (allocated 2097152) (tried to allocate 397312 bytes) at C:\app\apache_php\apache2\htdocs\ouvidoria\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:91)"} []

[2016-10-08 16:50:05] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\OutOfMemoryException: "Error: Out of memory (allocated 2097152) (tried to allocate 16384 bytes)" at C:\app\apache_php\apache2\htdocs\ouvidoria\vendor\symfony\symfony\src\Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator.php line 65 {"exception":"[object] (Symfony\Component\Debug\Exception\OutOfMemoryException(code: 0): Error: Out of memory (allocated 2097152) (tried to allocate 16384 bytes) at C:\app\apache_php\apache2\htdocs\ouvidoria\vendor\symfony\symfony\src\Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator.php:65)"} []

@jakzal
Copy link
Contributor

jakzal commented Mar 10, 2017

@cirovargas can you try to upgrade to Symfony 3.2? Symfony 3.1 doesn't receive bug fixes anymore.

Also, are you able to answer stof's questions?

which folder is growing that large inside the cache ? Are you able to determine it ?

One more test you could do is to try a fresh installation of standard edition. This will rule out (or confirm) the possibility there's something in your code causing the leaks.

@nicolas-grekas
Copy link
Member

Could be fixed by #21973, please confirm.

@nicolas-grekas
Copy link
Member

Rereading, maybe not in fact :) Please upgrade to 3.2 then report again as suggested.

@HeahDude
Copy link
Contributor

ping :)

@nicolas-grekas nicolas-grekas self-assigned this Apr 17, 2017
@javiereguiluz
Copy link
Member

Closing it due to lack of feedback. Please upgrade to Symfony 3.3 (to be released next week) and reopen this issue if the issue persists. Thanks!

@cirovargas
Copy link
Author

Using Symfony 3.4 now, my cache folder grew up 246GB
scachelolulo

@jakzal
Copy link
Contributor

jakzal commented Feb 7, 2018

Which folder inside cache/dev or cache/prod grows so much?

@javiereguiluz
Copy link
Member

javiereguiluz commented Feb 7, 2018

Maybe it's cache/test/ (that's the one which grows the most in my apps ... and it's because of the profiling data: var/cache/test/profiler/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants