title: Composer: Allowed memory size error when installing package
body: <p>When I run <code>composer require yab/laravel-scout-mysql-driver</code> this is the output that I get:</p>
  
  <pre><code>Using version ^2.40 for yab/laravel-scout-mysql-driver
  ./composer.json has been updated
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.3.2/libexec/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  
  Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.3.2/libexec/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  
  Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
  </code></pre>
  
  <p>I'm running Composer 1.9.2.</p>
  
  <p>Here are the last few lines of the output when I use -vvv:</p>
  
  <pre><code>Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-ircmaxell$password-compat.json from cache
  Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-paragonie$constant-time-encoding.json from cache
  Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-yab$laravel-scout-mysql-driver.json from cache
  Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-symfony$class-loader.json from cache
  Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-symfony$polyfill-apcu.json from cache
  Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-symfony$polyfill-xml.json from cache
  Reading /Users/redacted/.composer/cache/repo/https---repo.packagist.org/provider-gecko-packages$gecko-php-unit.json from cache
  PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.3.2/libexec/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  
  Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.3.2/libexec/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  
  Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
  </code></pre>
  
  <p>My memory limit is 128M. <a href="https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors" rel="noreferrer">https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors</a> doesn't seem to provide lot of insight other than to increase my memory limit but it seems like 128M should be sufficient?</p>
  
  <p><code>php -d memory_limit=-1 /usr/local/bin/composer require yab/laravel-scout-mysql-driver</code> did not help - I got "<em>Allowed memory size of 1610612736 bytes exhausted</em>" errors. Same thing with <code>memory_limit=1024M</code>.</p>
  
  <p>I did <code>php --ini</code> and from that got <code>/usr/local/etc/php/7.1/php.ini</code>, which I edited to change the memory limit 1024MB and am getting the same thing: "<em>Allowed memory size of 1610612736 bytes exhausted</em>".</p>
  
  <p>It's weird that the "allowed memory size" is the exact same in every instance. It's like nothing I'm doing is actually changing the memory size.</p>
  
  <p>Any ideas?</p>