-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Suggestion to fix "If you encounter the error Allowed memory size of XXXXX bytes exhausted" error #77
Comments
Maybe. For the moment we have this: https://phpinsights.com/get-started.html#allowed-memory-size-of-x-bytes-exhausted. |
@nunomaduro I am facing this issue inside a docker (dev without memory limit). |
Seems to be arround the 2 GB (default memory for docker) minus whatever you are running on that docker. |
Well, I did it also in my local machine mac pro with 16Gb ram and same problem... Also as I said PHP (local machine) has memory_limit = -1 However, I'll see those configurations with more precision. |
After 13 secs stops... I'm using ide-helper and the error is almost the same: /var/www/vendor/nunomaduro/phpinsights/src/Domain/Insights/SniffDecorator.php on line 65 92/592 [▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░] 15% 13 secs
|
@sierrafayad I have tested also in my local machine without docker ... I have 16Gb memory is mac pro, lock at my last post. |
@apoca Did you allowed extra memory to insights? https://phpinsights.com/get-started.html#allowed-memory-size-of-x-bytes-exhausted |
As I said (memory_limit = -1): php -d memory_limit=160000M ./vendor/bin/phpinsights -v 123/592 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░] 20% 23 secs
error_log: [02-Apr-2020 17:32:28 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1003520 bytes) in /Applications/MAMP/htdocs/esolidar-api/vendor/nunomaduro/phpinsights/src/Domain/Insights/SniffDecorator.php on line 65 |
If you run |
gives me... as expected memory_limit => -1 => -1 |
Well idk 😅 hahaha. |
Then, before I came here I did a lot of testes I have tried almost every thing and I got without solutions... This happened before with other stuff and I have fixed as you guys said in docs... Therefore, I am also without ideas :/ |
@sierrafayad Currently we don't touch memory limit in the code. @kayandra I like the idea of trying to use generators in more places. Might help us save some memory around the system. |
@olivernybroe, yes I agree with you and it might that is happening with other developers and they prefer to uninstall the package. I suggest that this bug must be open. |
@apoca I think it makes more sense to create an issue which is for adding generators. Adding generators does not fix memory size, it just reduced the likability of it happening. |
My latest comment on this issue can help others : |
If you encounter the error Allowed memory size of XXXXX bytes exhausted, the current workaround is to increase the memory limit:
While reading the docs, I saw this statement and it was something I ran into pretty quickly when adding insights my projects.
I'm only making a suggestion as I have not had the time to make a clone of the repo to see if it is possible. But, I was thinking, this might be a good use for PHP Generators. They make memory management in PHP tolerable when dealing with large data.
The text was updated successfully, but these errors were encountered: