Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When scanning modules sometimes I get Allowed memory size of 134217728 bytes exhausted
from PHPStan although the PHP memory limit is 512MB.
Steps to reproduce
TBD
Proposed resolution
Not sure the best solution but it works for me to append --memory-limit=-1
to the phpstan analyze
command.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#4 | 3224829.patch | 724 bytes | Gábor Hojtsy |
Comments
Comment #2
Gábor HojtsyRight, since we execute phpstan in its own process, it would use the PHP CLI memory limit, not the one that normally applies to Drupal. Would there be potential downsides setting the memory limit to -1?
Comment #3
aangel CreditAttribution: aangel commentedI just hit this issue and adding that extra switch worked for me.
Hard to see downsides to giving PHP free reign with memory in this case, after all it's a tool run sporadically and typically on dev machines. Even if run on production, the memory increase is localized to just the tool rather than it being a production-wide modification.
Comment #4
Gábor HojtsyOk that would look like this. Let's get it tested.
Comment #6
Gábor HojtsyOk got this in. Will see if there are any complaints.