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
Memory leak in PhpFilesAdapter #29643
Labels
Comments
Merged
Can you please confirm #29644 fixes the issue? |
Yes, it fixes the issue. Before fix
After fix
|
nicolas-grekas
added a commit
that referenced
this issue
Dec 19, 2018
This PR was merged into the 4.2 branch. Discussion ---------- [Cache] fix bad optim | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29643 | License | MIT | Doc PR | - Commits ------- b76d4ea [Cache] fix bad optim
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected: 4.2.x
Description
After upgrading from Symfony 4.1 to Symfony 4.2 Behat tests started to eat a lot of memory. Before upgrade 5k tests used about ~200 Mb of memory, after upgrading process fails on ~2Gb memory limit.
The problem is that this exception https://github.com/symfony/cache/blob/5ec26f9aacf8a054f437f1f12f6d3c8ec23e8c18/Adapter/PhpFilesAdapter.php#L35 somehow references to Behat\Behat\Context\Environment\InitializedContextEnvironment. So all application classes are stored in memory and each test increases memory usage significantly.
I used meminfo to find leaks
How to reproduce
It is hard to reproduce on Symfony skeleton.
Possible Solution
Create new exception inside closure. It solves the problem,
https://github.com/symfony/cache/blob/master/Adapter/PhpFilesAdapter.php#L35
The text was updated successfully, but these errors were encountered: