Open pfbernardo opened 2 years ago
Hi there, this package has been surpassed by it's successor https://github.com/tenancy/tenancy. Have you tried using that package instead of this old one?
Hi @bkintanar, this is a project that started 3 years ago and is in production. To migrate to it's successor would be a big endeavor. Not possible right now. I'm having this memory leak for a while now, but it is getting worse with more tests.
Right now, to go around this problem, I've been running phpunit with the process-isolation set to true, but the tests run much slower.
Hi,
I'm using your package in a project and I started to have memory consumption increasing running phpunit. The more tests I have the more memory phpunit uses (have around 4500 tests and it reaches around 6 GB). Just to be sure I did a test that actually does not test anything, except doing a loop where I create the laravel application and then flush it.
..
Actual behavior
Just to be sure I installed a fresh laravel application (see version details below) and run the test without laravel hyn. The results where this:
You can see that there is a memory leak but not to much.
With Laravel hyn 5.8 package installed here are the results:
You can see that the memory leak increases. Then on my main project I started commenting / removing service providers, and the one that made a big difference was the Hyn\Tenancy\Providers\TenancyProvider.
With the provider:
Without the provider: You can see the difference, it is huge.
I then started to look at the TenancyProvider, commenting and un-commenting the inner service provider and the problem is on the EventProvider. If I comment just this line see the difference:
Even on the standalone project there is a difference from 202MB to 86MB without the EventProvider.
.. Expected behavior
The EventProvider should not have such a big memory leak when running PhpUnit tests.
..
Information
tenancy.php config
webserver.php config
Thank you