title: Composer memory exhausted on shared host
body: <p>A previously working sandbox on a shared FreeBSD host now fails to run composer update or install with a memory exhausted error.  Before yesterday I was able to run <code>php ./composer.phar update</code> without a problem.  I do not believe that more memory is required.  I can update the project on a Windows system without any issue. What variables other than memory size contribute to the memory exhausted error?</p>
  
  <p>To test this I moved the contents of .../vendor and the composer.lock file to a different directory then ran <code>php ./composer.phar install --prefer-dist</code>. [Composer is in the project directory so that I can update it locally rather than expect the host master to keep it updated.]  The above command results in:</p>
  
  <pre><code>% php ./composer.phar install --prefer-dist
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 134217728 bytes) in phar:///home/projectmana/www3.projectmana.org/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220
  
  Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 134217728 bytes) in phar:///home/projectmana/www3.projectmana.org/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220
  </code></pre>
  
  <p>Composer is version 1.20</p>
  
  <p>composer.json used:</p>
  
  <pre><code>{
      "name": "truckee/projectmana",
      "license": "MIT",
      "type": "project",
      "description": "Project MANA administrative application",
      "autoload": {
          "psr-0": {
              "": "src/"
          }
      },
      "repositories": [
          {
              "type": "package",
              "package": {
                  "name": "jquery/jquery",
                  "version": "1.11.1",
                  "dist": {
                      "url": "https://code.jquery.com/jquery-1.11.1.js",
                      "type": "file"
                  }
              }
          }
      ],
      "require": {
          "braincrafted/bootstrap-bundle": "~2.0",
          "doctrine/doctrine-bundle": "~1.4",
          "doctrine/doctrine-fixtures-bundle": "^2.3",
          "doctrine/orm": "^2.4.8",
          "friendsofsymfony/user-bundle": "~2.0@dev",
          "incenteev/composer-parameter-handler": "~2.0",
          "javiereguiluz/easyadmin-bundle": "~1.1",
          "jms/security-extra-bundle": "~1.5",
          "jquery/jquery": "1.11.*",
          "knplabs/knp-menu-bundle": "~2.0",
          "nelmio/alice": "^2.1",
          "oyejorge/less.php": "~1.5",
          "paragonie/random_compat": "^2.0",
          "php": "&gt;=5.3.9",
          "psliwa/pdf-bundle": "dev-master",
          "sensio/distribution-bundle": "~4.0",
          "sensio/framework-extra-bundle": "^3.0.2",
          "symfony/assetic-bundle": "dev-master",
          "symfony/monolog-bundle": "~2.4",
          "symfony/swiftmailer-bundle": "~2.3",
          "symfony/symfony": "2.8.*",
          "twbs/bootstrap": "3.0.*",
          "twig/extensions": "1.0.*"
      },
      "scripts": {
          "post-install-cmd": [
              "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
              "Braincrafted\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::install"
          ],
          "post-update-cmd": [
              "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
              "Braincrafted\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::install"
          ]
      },
      "config": {
          "bin-dir": "bin"
      },
      "minimum-stability": "stable",
      "extra": {
          "symfony-app-dir": "app",
          "symfony-web-dir": "htdocs",
          "incenteev-parameters": {
              "file": "app/config/parameters.yml"
          },
          "branch-alias": {
              "dev-master": "2.3-dev"
          },
          "repositories": [
              {
                  "type": "composer",
                  "url": "http://packages.zendframework.com/"
              },
              {
                  "type": "composer",
                  "url": "http://packagist.org/"
              }
          ]
      },
      "require-dev": {
          "liip/functional-test-bundle": "^1.4",
          "symfony/phpunit-bridge": "^3.0"
      }
  }
  </code></pre>
  
  <p>Edit:
  Available memory:</p>
  
  <pre><code>% php -r "echo(ini_get('memory_limit'));"
  128M
  </code></pre>
  
  <p>Requested <code>free -m</code>: 
  % free -m
  free: Command not found.</p>
  
  <p>with <code>-vv --profile</code>:</p>
  
  <pre><code>% composer update -vv --profile
  [9.9MB/0.01s] Loading composer repositories with package information
  [10.5MB/0.80s] Updating dependencies (including require-dev)
  PHP Fatal error: ...
  </code></pre>
  
  <p>Edit #2, fatal error (using composer 1.1.0) continued, as it differs from that above:</p>
  
  <pre><code>Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32 bytes) in phar:///usr/local/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  
  Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32 bytes) in phar:///usr/local/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  </code></pre>