Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Composer update runs out of memory #1898
Comments
|
Could you maybe share your composer.json so it's at least possible to try and reproduce it? |
jrooi
commented
May 15, 2013
|
Yeah ofcourse, sorry!
Those two Lsg requires are internal, private bundles. The json of those two bundles are:
And the last one:
|
todsul
commented
May 15, 2013
|
We're receiving this error too. Increasing to 1G in php.ini worked. .json below... { |
mac-cain13
commented
May 17, 2013
|
I also can confirm this issue, after updating composer I can't update our projects without raising the memory_limit from 512MB to 1GB. Seems that memory usage increased quite a lot. Here is one of our composer.json files that are problematic: {
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*-dev",
"twig/extensions": "1.0.*-dev",
"symfony/assetic-bundle": "2.1.*-dev",
"symfony/swiftmailer-bundle": "2.1.*-dev",
"symfony/monolog-bundle": "2.1.*-dev",
"sensio/distribution-bundle": "2.1.*-dev",
"sensio/framework-extra-bundle": "2.1.*-dev",
"sensio/generator-bundle": "2.1.*-dev",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*-dev",
"friendsofsymfony/rest-bundle" : "0.10.*-dev",
"doctrine/doctrine-migrations-bundle" : "dev-master",
"richsage/rms-push-notifications-bundle" : "*",
"imagine/Imagine": "dev-develop",
"stof/doctrine-extensions-bundle": "dev-master",
"mlpz/postmark-bundle": "*",
"jms/serializer-bundle" : "dev-master",
"craue/twigextensions-bundle": "dev-master",
"wrep/bugsnag-php-symfony" : "dev-master",
"wrep/notificato-symfony" : "1.0.*",
"wrep/daemonizable-command": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}I just added the
|
jameshalsall
commented
May 18, 2013
|
EDIT: I can confirm that upping a 1gb limit fixes, but surely an issue. Composer JSON: {
"autoload": {
"psr-0": {
"": "src/"
}
},
"config": {
"bin-dir": "bin"
},
"description": "Tickit Application",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
},
"minimum-stability": "dev",
"name": "tickit-project/tickit",
"require": {
"doctrine/doctrine-bundle": "1.2.x-dev",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/orm": "2.3.*",
"friendsofsymfony/user-bundle": "2.0.x-dev",
"jms/di-extra-bundle": "1.3.x-dev",
"jms/security-extra-bundle": "1.4.x-dev",
"php": ">=5.3.3",
"sensio/distribution-bundle": "2.3.x-dev",
"sensio/framework-extra-bundle": "2.3.x-dev",
"sensio/generator-bundle": "2.3.x-dev",
"stof/doctrine-extensions-bundle": "1.1.x-dev",
"symfony/assetic-bundle": "2.1.x-dev",
"symfony/monolog-bundle": "2.2.x-dev",
"symfony/swiftmailer-bundle": "2.2.x-dev",
"symfony/symfony": "2.3.x-dev",
"symfony/console": "2.3.x-dev",
"twig/extensions": "1.0.x-dev",
"psr/log": "1.0.0",
"tickit-project/cache-bundle": "1.0.x-dev",
"squizlabs/php_codesniffer": "1.*",
"behat/symfony2-extension": "dev-master",
"satooshi/php-coveralls": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
}
} |
mddubs
commented
May 23, 2013
|
Same issue since updating Composer. 1GB workaround does work, but something must be wrong. Composer: 950fc7e |
michaldudek
commented
Jun 6, 2013
|
Now I've hit 2GB memory limit ;) I'm getting 16GB RAM tonight so gonna increase the php memory limit to around 10, should last for few months of updates :P |
michaldudek
commented
Jun 6, 2013
|
Updating my CLI to php54 fixed it for now. |
|
Yup, upgrading to php5.4.x fixes a memory issue when using php 5.3.x. For example, I was running composer install without a .lock file. With php5.3.10, composer required over 3GB of memory. With php5.4.16, composer consumed less than 1GB. |
Dynom
commented
Jul 4, 2013
|
Needing 512MiB RAM for a package-manager is already a bit much, but I also exceed it. The interesting part is that I exceed 512 MiB RAM (up to around 800 MiB RAM according to my process output) when I use my private Satis repository (which is actually just a cache for all Github public repositories). I do not exceed it otherwise. Just by adding my satis repository, composer consumes almost 400 MiB more RAM. I'm on PHP 5.4.14. To all the others raising their PHP CLI memory_limit globally, I recommend against that. Instead I suggest to put it in the command line, like so:
Otherwise you could potentially miss certain unintended memory related behaviour in your own work. |
tyler-sommer
commented
Jul 18, 2013
|
Chiming in with my experience. I'm also using a private Satis repository in addtion to the zend framework repository. I was having problems with composer update on PHP 5.3.26 using over 2GB of memory. Switching to 5.4 solved everything, now using under 400MB. |
jameshalsall
commented
Jul 18, 2013
|
ping @Seldaek |
Taiger
commented
Jul 19, 2013
|
Thanks @Dynom, this works for those of us on PHP <5.4 php -dmemory_limit=1G composer.phar update |
jjanvier
commented
Jul 23, 2013
|
Same problem |
iVariable
commented
Aug 3, 2013
|
Same here. Mac OS X. PHP 5.3.15. |
baohx2000
commented
Aug 27, 2013
|
Happening to me on 5.5. Guessing something somewhere is not cleaning up after itself and leaving objects hanging around? |
|
Same problem with php 5.3.15 on Mac OS X. |
atmediauk
commented
Aug 28, 2013
|
Same problem here. I can't get it to composer update as I only have 1gb total for this particular vps. PHP 5.4.11 (cli) (built: Feb 20 2013 19:02:54) ----> Update I updated the production server from 5.4.11 to 5.4.19 and composer update seems to be working now. |
kmmathis
commented
Aug 30, 2013
|
Had this issue until I upgraded to PHP 5.4.19. |
IAkumaI
commented
Sep 27, 2013
|
I'm also have a problem, but yesterday it worked fine with the same composer.json |
MPLLC
commented
Oct 2, 2013
|
Ugh, this is a killer on shared hosting. |
|
@kevinm1 it's not, you are not supposed to run composer update on your production server. You should run update on your dev box then deploy the composer.lock file and run install which will run with very low memory footprint and very fast since it doesn't have to check for new packages but merely applies what's in the lock file. |
Imunhatep
commented
Oct 15, 2013
|
Yep, same here - have to increase memory limit to 1G. And indeed it eats up to 980M. Interesting thing is that this started to happen only after I added local Satis composer repository which in fact holds only cached .zip packages mostly if not only from github. Without local Satis repository, composer uses around of 240mb. "repositories": [ Happens on Gentoo with PHP 5.4.16 |
kureikain
commented
Oct 20, 2013
|
I was on PHP 5.5.5. Cannot solve this. Tried to disable lots of extension: opcode, xdebug,..I actually ended up creating swap file. My VPS is 512MB (a cheap digital ocean instance) with a handful of service: nginx, mariadb, mongodb, redis. puma. to clarify, I was not able to run a simple single command for installing laravel
Here is my simple work around, hopefully help s.o:
confirm u see your swap there: Then install composer, and wat your RAM ;(
|
kmmathis
commented
Oct 21, 2013
|
Most of the people getting errors related to this ticket seem to be trying to create projects and/or updating with composer on their servers. Best practice is running your |
kureikain
commented
Oct 21, 2013
|
I did what u said, and it fail right on that command...I actually ended up creating a swap file to expand memory.. |
uwej711
commented
Oct 21, 2013
|
While
|
mrchimp
commented
Nov 5, 2013
|
@kmmathis I'm getting the same problem when I do |
Glideh
commented
Nov 5, 2013
|
|
|
maybe there is a substantial problem building dependency graph, that needs to be addressed?... |
Dynom
commented
Nov 20, 2013
|
I think you might be on to something there @nfx ;-) I'd like to remind everyone, including myself, that Composer is OSS and can be forked and improved by yourself! |
frangeris
commented
Nov 28, 2013
|
Same problem here, |
mrchimp
commented
Nov 28, 2013
|
@frangeris Increasing swap space seems to have helped. |
euskadi31
commented
Dec 1, 2013
|
|
djlambert
commented
Dec 8, 2013
|
I received this error with PHP 5.5.6 x64 on Win7, |
jkup
commented
Dec 15, 2013
|
Same as others, 1G solved my issue but even at 512M it had errors. |
lenybernard
commented
Dec 18, 2013
|
Same problem ;-( |
musixite
commented
Dec 19, 2013
|
@Seldaek "deploy the composer.lock file and run install" I know this is probably basic for you but could you please tell me how to do this on the command line? Thanks!
|
mrchimp
commented
Dec 20, 2013
|
@musixite The composer.lock is basically a copy of composer.json (with some timestamps added). When you run
So What @Seldaek is saying is that you should push to your project to your production server with a composer.lock file attached and then run Hope that helps! |
geoffreytran
commented
Dec 26, 2013
|
Running into this issue also. There shouldn't be a reason for composer to need this much memory. |
proligde
commented
Jan 3, 2014
|
Same here with 512M RAM using PHP 5.5.3 |
judgej
commented
Jan 13, 2014
|
Getting this problem on our dev server too, for the first time. Trying to set the memory limit in the command line just gives us this:
However, running the command about six times eventually completed without an error. I don't know if each run leaves enough cached data behind to pick up where it left off, working further on each run, or something else was affecting how much memory it needed. |
|
@judgej I guess you are just at the edge of your server's memory so it gets killed or not depending on the amount of ram used when you start composer. Anyway you should avoid running |
judgej
commented
Jan 13, 2014
|
Servers are where I kind of do my development. The composer.lock and install steps I can understand for migrating to other server instances - test/staging/production/whatever - but am I in the minority doing work on a "server" rather than my own laptop or workstation? I have too many things on the go at once to work any other way (or maybe I need a bigger laptop with a zillion VMs :-). On the plus side, at least I know I'm not blowing the 1G limit by too much ;-) |
judgej
commented
Jan 13, 2014
|
So out of curiosity, is there a fundamental reason why an update has to use that much memory, or is it something that is lower on the priorities to fix or optimise because people should only be doing this on a machine with enough resources? Just wondering if there is hope for using less memory (with fixes by whoever), or if it ain't gonna happen (because it can't) and it must be handled by the resources we must throw at it. |
|
@judgej I don't know if you are in the minority or not, I think it depends on the sort of demographic you are looking at. In the people I know doing mostly the things I do, most work on their own laptops, either in VMs or in the native OS. That usually gives you more allowances regarding memory. I'm sure other communities/groups tend to still rely more on dev servers. By the way the As for why it's using so much, unfortunately it's not such an easy fix, I wish I'll have time to dedicate to that some day, but right now it's using lots because it loads tons of packages in memory and php isn't the most memory efficient beast out there. Upgrading to php 5.4 or even 5.5 should help on that front by the way, 5.3 is quite wasteful. |
judgej
commented
Jan 13, 2014
|
Being able to see how memory is being used graphically would be cool, one day, for seeing just where it all goes. I kind of guessed the Thanks for spending your time explaining, much appreciated :-) |
froddd
commented
Jan 13, 2014
|
Seeing all this, is there much point in excluding the lock file from version control? If we're encouraging |
|
@froddd there is strictly no point about excluding the lock file from version control for projects (and the doc advices to version it). If you run |
TehWan
commented
Jan 16, 2014
|
Could it be possible to add to the system requirements a note about the high memory usage? @judgej is not the only one who needs to run it on low memory systems, and most of my VMs usually don't have 512MB+ free for PHP, it's more in the range of 128-256MB. We don't all have high-end computers in an enterprise environment. ;) |
judgej
commented
Jan 16, 2014
|
I actually had to copy the composer.json to a production server with lots of memory, run I have been thinking about these memory issues for the last few days. Is there a discussion or overview somewhere that lays out the issues that is causing the memory usage to be so high? I'm wondering if we understand the problems more, we may be able to help. Is there a way to work out the dependencies without opening up all the packages in memory, i.e. just getting hold of the composer.json files for each package without the rest of the files it contains (I'm assuming composer.json is all that is needed - but I may be wrong)? Or could packages be extracted to a temporary folder rather then into memory, using a shell command (when run on Linux), since the shell command does not use PHP's memory allocation and memory is cleaned up a little better when the shell command ends. This is becoming a bigger issue as more frameworks use composer for all their packages. I'd like to help, so if there are any pointers on where to get started (a description of perhaps why this is not a trivial problem to solve) then that would help a lot. |
|
@judgej a Package object for Composer contains only the information of the composer.json file (and not even all of them during the solving of dependencies). Composer does not download the packages themselves until it install them. your suggestion are all talking about moving the extraction of packages out of PHP, while the issue comes from the amount of extracted data which is needed by the PHP code The issue is that the algorithm resolving dependencies needs to be fed with all potential matches for a constraint, and when you require We are talking about optimizing the most complex part of composer here, for which a long time of development was already used (to give you a quick idea, during the first months of development of Composer, @naderman worked quite only on the dependency solver while @Seldaek was building the surrounding infrastructure). |
judgej
commented
Jan 16, 2014
|
@stof Thanks, that makes a lot of sense. So it is not necessary to download a package to see its metadata (composer.json), which is good. However, you need to download the full (-ish, depending on constraints) history of each package so the information needed to make the right dependency choices is available. I can see there would be many possible combinations to work through, with a lot of data, and PHP is not good at tidying up memory as it goes along. How does this stuff all fit in one tiny script? ;-) Incredible work. I wonder how it would work if taken online, with a database to manage the data? Just composer.json in and composer.lock out? A throw-away thought...but I've got to ask the stupid questions. |
tantam
commented
Jan 22, 2014
|
get similar issue, when i try to run "composer update" with "minimum-stability": "dev" , i just change to "minimum-stability": "stable" and it's work :) |
ChristopheCubat
commented
Jan 27, 2014
|
Hitting 3G now... at this pace... (1G a month)... I will be need to change my computer in 4 month... :-S |
baohx2000
commented
Jan 27, 2014
|
HHVM can run phar files now. One of my coworkers tried it out with composer and it used less cpu, time, and memory. |
|
Indeed, if you have HHVM available, that'll help a lot. |
|
yeah, HHVM improves things a lot (especially regarding time as it is far more efficient at running complex computations) |
svenvarkel
commented
Jan 28, 2014
|
Same problem here. To all those who recommend to increase memory limit - memory leaks cannot and must not be fixed by throwing more memory at it. |
|
Well it's not a leak. It simply needs a lot of memory. |
BevanR
commented
Oct 23, 2014
|
I had to increase to 1024-2048MB for {
"require": {
"drupal/drupal-extension": "dev-master"
},
"require-dev": {
"igorw/composer-yaml": "*"
},
"minimum-stability": "dev",
"prefer-stable": true
} |
TheAifam5
commented
Oct 26, 2014
|
I have problem. Composer use all of available ram(6GB) and 1GB Swap(max: 7GB) and freeze system... My linux lost stability and i must restart ... |
TheAifam5
commented
Oct 27, 2014
|
Please add information to disable XDebug(zend plugin)... After disabled, Composer work perfectly, without timeout, without too much eat RAM, out of memory and freezing system. ;) |
namreg
commented
Oct 28, 2014
|
thanks @theaifam5! |
joelrotelli
commented
Oct 29, 2014
|
@theaifam5 How do you disable xdebug please ? Thanks |
BevanR
commented
Oct 29, 2014
|
Comment out any lines mentioning it in your php.ini file. |
namreg
commented
Oct 30, 2014
|
@joelrotelli you need just disable profiling feature in xdebug.
|
joelrotelli
commented
Oct 30, 2014
|
OK thanks. Passing to PHP5.4 solve my problem too. |
TheAifam5
commented
Oct 30, 2014
|
so... if you used PHP Web Server, copy a So, now you must disable XDebug globally in So. Globally XDebug is disabled, but for server have own configuration with enabled XDebug.. XDebug is enabled only for webserver because using own configuration. If you using PHPStorm, add to your configration in :) Yea, nice commit: 10f8e56 Shit not working(commit), no showing any warnings about XDebug ;p Bravo ! |
ammont
commented
Oct 31, 2014
|
Same problem here
|
nvartolomei
commented
Nov 3, 2014
|
same problem with php56 installed via homebrew with fpm and debug, it was ok with php shipped with yosemite |
wiesson
commented
Nov 4, 2014
|
same here as @nvartolomei (vagrant/puphpet, php56, ubuntu14.04, windows) |
ikari-pl
commented
Nov 4, 2014
|
@wiesson and others using laravel: try applying what @barryvdh suggested to me: #1898 (comment) — directly adding symfony subdependencies from laravel dramatically reduces the memory usage for this command. For me it worked like a charm. |
energylevels
commented
Nov 12, 2014
|
I dunno why this needs so much memory but makes it a non starter on limited shared hosting environments .... |
MPLLC
commented
Nov 18, 2014
|
If we're supposed to only commit lock files to production, why, then, does composer not allow the installation of vendor packages without the json file? And, again, this memory issue is killing me on shared hosting. Something needs to be done, as it's ridiculous to ask people to increase memory when they might not be able to. |
cjunge-work
commented
Nov 18, 2014
|
@kevinm1 I think you've misunderstood the suggestion. The composer.json file must always been committed, but the lock file should also be committed as it is used in a If the composer.lock file does not exist, then using Hope that helps. |
nvartolomei
commented
Nov 18, 2014
|
Both files are needed. You should run update only on dev machine (environment). Problems like this are not always meant to be fixed by the way, hardware are better now so we can use more of it, or if you want you can rewrite entire composer in assembler
|
moafred
commented
Nov 19, 2014
|
Thanks to @nasr, disable xdebug fix this for me
|
|
Recent patches improve memory usage slightly (0-50% reduction it seems depending on packages), but if you have large sets of packages it might still use a lot, and using a composer.lock to deploy to production (especially if prod has low memory like shared hosting) is still the best practice, not just for performance reasons. |
CaptainN
commented
Dec 4, 2014
|
I had this problem the other day. It turned out to have nothing to do with any real bug, it's just that the documentation on the composer website about how to set up composer globally on OSX using brew doesn't tell you that brew installs an old outdated version of composer, and that you have to update it with: composer selfupdate After running composer selfupdate I didn't have this bug anymore. It took quite a bit of searching to figure that out. It would probably be easier, and maybe even reduce reports, if the composer getting started page explained this. |
startinggravity
commented
Dec 4, 2014
|
Wonderful catch, and so timely too! Thanks, @CaptainN. Your solution fixed the memory problem I ran into while installing Codesniffer. |
matyhaty
commented
Dec 22, 2014
|
Running
Fixed it for me. I was having memory issues even when set to 5120000M!!! |
collinanderson
commented
Dec 23, 2014
|
|
jeankleemann
commented
Dec 31, 2014
|
I had same problem with: |
seanlindo
commented
Jan 8, 2015
|
@CaptainN This worked perfectly. |
mrofi
commented
Jan 9, 2015
|
I have same issue when I would install laravel 4.2 on my openshift gear. |
velikanov
commented
Jan 14, 2015
|
@Seldaek |
mailightkun
commented
Jan 20, 2015
|
This solved my problem base on their Suggestion: |
phirschybar
commented
Jan 25, 2015
|
this worked for me as well: https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors |
RobQuistNL
referenced this issue
Jan 27, 2015
Closed
Composer runs out of memory when trying to install Sylius on Windows #3664
kumarramalingam
commented
Mar 19, 2015
|
Solve this problem. Update PHP Version. 1.sudo apt-get update 2.sudo apt-get install lamp-server^ That's all. |
cbrunnkvist
commented
Jun 12, 2015
|
"You're on the wrong server" / "You don't have enough swap" / "Framework X is an edge-case" / "Problems like this are not always meant to be fixed"?? Whaaaat, seriously? Is everybody (with the brilliant exception of @stof and @judgej) turning into total apologists? The issue still remains: something is wrong, because it is insane that such an important and central tool such as the dependency manager, should gobble up gigglypiles of memory just in order to complete it's most basic tasks. |
cbrunnkvist
commented
Jun 12, 2015
|
For reference: mem usage stays stable on my Yosemite Mac (PHP 5.5.20) but totally blows up on my Ubuntu Trusty deployment (PHP 5.5.9-1ubuntu4.9). None of the workarounds above has any effecty ~ it must be some triggering some leak in that older ("stable") version of PHP. |
Dependency resolution is not it's most basic task, on the contrary it is the most complex task. Being such a critical piece of the application, it is rather difficult to make improvements to. Servers generally have less memory than a development machine and it is recommended to do the update in your development environment and simply do an install from the lock on a server. The solver is computing a solution for a graph theory equation. It basically does a tsort with an unbounded set discovering additional dependencies to consider for resolution throughout the process. The larger the graph the more memory required to compute the result. When you introduce potential nodes to the graph via discovery through a service, like packagist, that provides a large number of alternatives it increases the complexity and required memory/compute time. A traditional tsort algorithm has a complexity of O(log^2 n). |
cbrunnkvist
commented
Jun 15, 2015
|
I would stress that my use of "basic" is not in the sense of "simplistic and of low complexity" - but in the meaning that this task is quintessential, and critical, to the goals of the program. If we can conclude that there is nothing obviously wrong with the algo. implementation itself, then one way to start dealing with the problem could be to build up a dataset of known PHP version where bloat occurs and at the very least display a warning at execution time. Ideas? |
|
It isn't a specific PHP version that causes bloat, it is a factor. Packages can have dependencies on different PHP versions. If you have a 5.3 installation of PHP you are eliminating candidates of packages that require php >5.4. The largest factor is the dependencies themselves. For instance The bloat generally occurs whenever you have a dependency somewhere down the line that has a large number of potential candidates. For instance, if you only require a subset of symfony packages they will need to be calculated individually to satisfy each constraint and dependency. If you drop that constraint down to The ideal goal of maintaining backwards compatibility with other open source packages, a good motivation IMO, is the main killer of the memory utilization of composer. When a new version is released that meets your constraint it needs to be evaluated. |
cbrunnkvist
commented
Jun 16, 2015
|
mpemberton5
commented
Jul 3, 2015
|
I turned off xdebug and still had problem. Turned off OpCode for cli and worked like a dream (and fast too). |
orhan-mobven
commented
Jul 16, 2015
|
I turned off xdebug and it works now. |
fabianhenzler
commented
Aug 27, 2015
|
Having it with HHVM too |
ronnyandre
commented
Sep 1, 2015
|
Thanks @kureikain |
chrisg123
commented
Sep 26, 2015
|
I was having this issue. Updating composer ( |
Aldibe
commented
Oct 23, 2015
|
i got this error when running
this is my composer.json
is it possible/normal for composer to allocate that much memory?? |
|
during an update, it can indeed use lots of memory |
kkomelin
commented
Oct 27, 2015
|
I might have missed some of the comments above but since this issue is still open I'll add my two coins. My system: My situation: I did this way because it's required by the official Drush documentation which is used by thousands so the suggestion to use composer on my local machine and then move to Git is not for me obviously. Of course, I can temporary increase memory to 1G but folks... really... it's too much for one utility tool and it's probably not a PHP problem but a problem of the composer architecture. So, maintainers please think about this when you're planning roadmap for future versions because I believe that no one utility tool deserves 1G of memory even if it's local machine memory. |
mojzis
referenced this issue
in Sylius/Sylius
Nov 13, 2015
Closed
Composer install fails on memory limit of 1Gb #3565
stefandoorn
commented
Nov 13, 2015
|
@barryvdh Ain't your suggestion more like this, just a suggestion:
|
TengfeiQi
commented
Dec 4, 2015
|
这个问题好蛋疼
|
SiliconMind
commented
Dec 14, 2015
|
I'd consider this more than serious. I just tried to install Symfony CMF. I needed to increase memory limit to 2G in order to avoid constant out of memory issues. Come one guys! There is something seriously wrong with the composer. I'm managing dozens of dev machines and it was the first time for past few years that I had to increase it's memory over 1G and for what? A composer install? With recent boom for small cloud dev machines this will become a serious issue. |
judgej
commented
Dec 14, 2015
|
@SiliconMind Be more specific about the version(s) you want to install. That is the key. Don't give composer the option to have to investigate every possible combination of every single package that is needed to install your framework; if you do, then it will be trying out many thousands of possible combinations to find the perfect latest compatible set of packages available, and it is that which eats memory. |
|
Did you check the tipps mentioned at https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors ? |
|
Also it would be very helpfull when you could create a blackfire profile of your run (after you increased php-memory-limit to a value high enough that it doesnt crash) |
SiliconMind
commented
Dec 14, 2015
|
@judgej You know, I can handle myself a lot but I don't think that's the point. Consider someone less experienced that visits Symfony's CMF install instructions and sees this: You can't expect that average John Developer will know composer inside out. And frankly, the versions for Symfony CMF are pretty precise. Maybe related packages are not specific enough, but you can't expect that all end users will now start to edit related composer.json files in hope of finding the source of the issue. |
SiliconMind
commented
Dec 14, 2015
|
@staabm xdebug was disabled. It was vanilla debian install without any additional stuff. As for the profile - I'm sorry, I can't do this now. |
nbpalomino
referenced this issue
in pagekit/pagekit
Jan 19, 2016
Closed
Request: Commit `composer.lock` File #528
garethmcc
commented
Feb 5, 2016
|
I have been plagued by this issue for over two years now and the official response is still "add swap"? This should not be a problem and its ridiculous that it isn't resolved yet. If a memory issue such as this made it into anything I released I would lose my job. |
jrooi commentedMay 14, 2013
Running the "composer update" command results in a fatal error:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 79 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 100
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 71 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 700
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 72 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 104
I already tried removing the vendors in my Symfony2 project. After removing the vendors and running a "composer install" command I get no errors. Running a "composer update" directly after the install results in the same memory error. The current memory limit is set to 512MB, that should be enough, right?
What can be the cause of the sudden memory issue? Can I take other steps in solving this issue? As far as I can tell, the dependencies haven't changed and I don't include many vendors.
Any help is much appreciated!
Kind regards,
Jeroen van Rooij
Ps. I'm using the latest composer version and al the requires in the json are set to a fixed version