Skip to content
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 limit not being passed to PHPStan #145

Closed
FatGuyLaughing opened this issue Mar 10, 2020 · 3 comments · Fixed by #171
Closed

Memory limit not being passed to PHPStan #145

FatGuyLaughing opened this issue Mar 10, 2020 · 3 comments · Fixed by #171

Comments

@FatGuyLaughing
Copy link

I'm still getting a memory issue even when running the following command. I've used "3G", 3G, and 3gb.

Command

php -d memory_limit=-1 vendor/bin/drupal-check --memory-limit=3G -d web/modules/contrib/panelizer

Error

PHPStan crashed in the previous run probably because of excessive memory consumption.
It consumed around 51 MB of memory.

To avoid this issue, allow to use more memory with the --memory-limit option.
 52/58 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░]  89%Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in phar:///Users/stevenworx/code/php/drupal/clients/internal/platforms/deprecated_check/vendor/phpstan/phpstan/phpstan/vendor/nikic/php-parser/lib/PhpParser/Lexer.php on line 264

It's only allocating 134M to the process. Is there something wrong with my command?

@daFish
Copy link

daFish commented Mar 16, 2020

Running the command with vendor/bin/drupal-check --memory-limit 8000M works for me. Maybe there is an issue with the G-notion?

@tbfisher
Copy link

tbfisher commented Apr 9, 2020

I'm seeing this as well

$ ../vendor/bin/drupal-check -vvv --memory-limit 128M -d modules/custom
Memory limit set to 128M
Performing deprecation checks
Current working directory: /home/app/web
Using Drupal root: /home/app/web
Using vendor root: /home/app/vendor
PHPStan configuration:
parameters:
	tipsOfTheDay: false
	reportUnmatchedIgnoredErrors: false
	excludes_analyse:
		- */tests/Drupal/Tests/Listeners/Legacy/*
		- */tests/fixtures/*.php
		- */settings*.php

	drupal:
		drupal_root: /home/app/web

	customRulesetUsed: true
	ignoreErrors:
		- "#\\Drupal calls should be avoided in classes, use dependency injection instead#"
		- "#Plugin definitions cannot be altered.#"
		- "#Missing cache backend declaration for performance.#"
		- "#Plugin manager has cache backend specified but does not declare cache tags.#"

	bootstrap: /home/app/vendor/mglaman/drupal-check/src/Command/../../error-bootstrap.php

includes:
	- /home/app/vendor/mglaman/drupal-check/src/Command/../../../../phpstan/phpstan-deprecation-rules/rules.neon
	- /home/app/vendor/mglaman/drupal-check/src/Command/../../../../mglaman/phpstan-drupal/extension.neon


 1502/1502 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 11 secs/11 secs 64.2 MiB

 -- --------------------------------------------------------------------------- 
     Error                                                                      
 -- --------------------------------------------------------------------------- 
     Child process error (exit code 255): Fatal error: Allowed memory size of   
     134217728 bytes exhausted (tried to allocate 20480 bytes) in               
     phar:///home/app/vendor/phpstan/phpstan/  
     phpstan/vendor/nette/utils/src/Utils/Random.php on line 24                 
                                                                                
     Child process error (exit code 255):                                       
     Child process error (exit code 255):                                       
     Child process error (exit code 255): Fatal error: Allowed memory size of   
     134217728 bytes exhausted (tried to allocate 262144 bytes) in              
     phar:///home/app/vendor/phpstan/phpstan/  
     phpstan/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php   
     on line 25                                                                 
                                                                                
     Child process error (exit code 255):                                       
     Child process error (exit code 255): Fatal error: Allowed memory size of   
     134217728 bytes exhausted (tried to allocate 20480 bytes) in               
     phar:///home/app/vendor/phpstan/phpstan/  
     phpstan/vendor/nikic/php-parser/lib/PhpParser/Lexer.php on line 264        

...                                                                                

@mglaman
Copy link
Owner

mglaman commented May 11, 2020

Sorry, the 1.1.x release to support phpstan 0.12 apparently dropped passing all of these parameters to PHPStan.

mglaman added a commit that referenced this issue May 11, 2020
mglaman added a commit that referenced this issue May 11, 2020
pass memory limit to phpstan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants