title: Composer always runs into "Allowed memory size of 1610612736 bytes exhausted" - on server as well as local
body: <p>I am using composer on my Laravel 6 project. However, somehow I always run into the problem is &quot;Allowed memory size of 1610612736 bytes exhausted&quot;. I don't know why but since a few days I have this problem and I don't know why or where it does come from.</p>
  <p>The curios thing is that I get exactly the same error on my development server. That means it must has to do something with the Laravel project itself. Because as I said, on my Mac as well as on my development server I get the exact same output with exact the same config and project.</p>
  <p>The only workaround is <code>php -d memory_limit=-1 composer update</code>. But I cannot do this on my server because I am not the admin of the server and have a limited RAM usage. So, I do want to know what is causing this problem and how I can solve this.</p>
  <p>Do you need any more information then those below?
  I appreciate any kind of help!</p>
  <p>Kind regards and thank you!</p>
  <p>My <code>composer.json</code>:</p>
  <pre><code>{
      &quot;name&quot;: &quot;laravel/laravel&quot;,
      &quot;type&quot;: &quot;project&quot;,
      &quot;description&quot;: &quot;The Laravel Framework.&quot;,
      &quot;keywords&quot;: [
          &quot;framework&quot;,
          &quot;laravel&quot;
      ],
      &quot;license&quot;: &quot;MIT&quot;,
      &quot;repositories&quot;: [
          {
              &quot;type&quot;: &quot;composer&quot;,
              &quot;url&quot;: &quot;https://nova.laravel.com&quot;
          }
      ],
      &quot;require&quot;: {
          &quot;php&quot;: &quot;^7.2&quot;,
          &quot;components/jquery&quot;: &quot;^3.4&quot;,
          &quot;cybercog/laravel-nova-ban&quot;: &quot;^1.1&quot;,
          &quot;emilianotisato/nova-tinymce&quot;: &quot;^1.1&quot;,
          &quot;fideloper/proxy&quot;: &quot;^4.0&quot;,
          &quot;glorand/laravel-model-settings&quot;: &quot;^3.5&quot;,
          &quot;inspheric/nova-indicator-field&quot;: &quot;^1.43&quot;,
          &quot;kabbouchi/nova-logs-tool&quot;: &quot;^0.2.0&quot;,
          &quot;laravel/framework&quot;: &quot;^6.2&quot;,
          &quot;laravel/nova&quot;: &quot;~2.0&quot;,
          &quot;laravel/socialite&quot;: &quot;^4.4&quot;,
          &quot;laravel/telescope&quot;: &quot;^3.0&quot;,
          &quot;laravel/tinker&quot;: &quot;^1.0&quot;,
          &quot;laravel/ui&quot;: &quot;^1.1&quot;,
          &quot;laravelcollective/html&quot;: &quot;^6.1&quot;,
          &quot;llaski/nova-scheduled-jobs&quot;: &quot;^3.0&quot;,
          &quot;mad-web/nova-telescope-link&quot;: &quot;^3.0&quot;,
          &quot;orangehill/iseed&quot;: &quot;^2.6&quot;,
          &quot;paquettg/php-html-parser&quot;: &quot;^2.1&quot;,
          &quot;pdewit/nova-external-url&quot;: &quot;^1.0&quot;,
          &quot;phpunit/php-code-coverage&quot;: &quot;^9.1&quot;,
          &quot;phpunit/phpunit&quot;: &quot;^9.2&quot;,
          &quot;spatie/laravel-honeypot&quot;: &quot;^1.4&quot;,
          &quot;spatie/laravel-medialibrary&quot;: &quot;^7.19&quot;,
          &quot;spatie/laravel-permission&quot;: &quot;^3.2&quot;,
          &quot;twbs/bootstrap&quot;: &quot;^4.3&quot;,
          &quot;vyuldashev/nova-permission&quot;: &quot;^2.9&quot;,
          &quot;yoeunes/toastr&quot;: &quot;^1.2&quot;
      },
      &quot;require-dev&quot;: {
          &quot;barryvdh/laravel-debugbar&quot;: &quot;^3.2&quot;,
          &quot;barryvdh/laravel-ide-helper&quot;: &quot;^2.6&quot;,
          &quot;brianium/paratest&quot;: &quot;^4.1&quot;,
          &quot;facade/ignition&quot;: &quot;^1.4&quot;,
          &quot;fzaninotto/faker&quot;: &quot;^1.4&quot;,
          &quot;mockery/mockery&quot;: &quot;^1.0&quot;,
          &quot;nunomaduro/collision&quot;: &quot;^3.0&quot;
      },
      &quot;config&quot;: {
          &quot;optimize-autoloader&quot;: true,
          &quot;preferred-install&quot;: &quot;dist&quot;,
          &quot;sort-packages&quot;: true
      },
      &quot;extra&quot;: {
          &quot;laravel&quot;: {
              &quot;dont-discover&quot;: []
          }
      },
      &quot;autoload&quot;: {
          &quot;psr-4&quot;: {
              &quot;App\\&quot;: &quot;app/&quot;
          },
          &quot;classmap&quot;: [
              &quot;database/seeds&quot;,
              &quot;database/factories&quot;
          ],
          &quot;files&quot;: [
              &quot;app/Helpers/helper.php&quot;,
              &quot;app/Helpers/commentsHelper.php&quot;
          ]
      },
      &quot;autoload-dev&quot;: {
          &quot;psr-4&quot;: {
              &quot;Tests\\&quot;: &quot;tests/&quot;
          }
      },
      &quot;minimum-stability&quot;: &quot;dev&quot;,
      &quot;prefer-stable&quot;: true,
      &quot;scripts&quot;: {
          &quot;post-autoload-dump&quot;: [
              &quot;Illuminate\\Foundation\\ComposerScripts::postAutoloadDump&quot;,
              &quot;@php artisan package:discover --ansi&quot;
          ],
          &quot;post-root-package-install&quot;: [
              &quot;@php -r \&quot;file_exists('.env') || copy('.env.example', '.env');\&quot;&quot;
          ],
          &quot;post-create-project-cmd&quot;: [
              &quot;@php artisan key:generate --ansi&quot;
          ],
          &quot;post-update-cmd&quot;: [
              &quot;Illuminate\\Foundation\\ComposerScripts::postUpdate&quot;,
              &quot;@php artisan ide-helper:generate&quot;,
              &quot;@php artisan ide-helper:meta&quot;
          ]
      }
  }
  
  </code></pre>
  <p>Output of <code>composer diagnose</code>:</p>
  <pre><code>Checking composer.json: OK
  Checking platform settings: OK
  Checking git settings: OK
  Checking http connectivity to packagist: OK
  Checking https connectivity to packagist: OK
  Checking github.com rate limit: OK
  Checking disk free space: OK
  Checking pubkeys:
  Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
  Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
  OK
  Checking composer version: OK
  Composer version: 1.10.10
  PHP version: 7.3.18
  PHP binary path: /usr/local/Cellar/php@7.3/7.3.18_1/bin/php
  OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
  
  </code></pre>
  <p>When I run this command:</p>
  <p>(Basically any commands where I install, remove or update packages)</p>
  <pre><code>composer update
  composer install
  ...
  ...
  </code></pre>
  <p>I get the following output:</p>
  <pre><code>PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.10.7/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
  
  Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.10.7/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
  
  Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
  </code></pre>