-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Cannot update packages anymore "Fatal error: Out of memory (allocated 1392771072) (tried to allocate 268435456 bytes)" #7348
Comments
How much memory does your machine have? Also, can you run the |
I have 16Gb of RAM. Here is the ouput of the profiler
|
And with verbose, the last lines are
|
It looks like it tries to allocate roughly 1gb, but memory limits won't allow more. It seems to me that the |
It could be generic - the mechanism to fork to disable Xdebug could be erroneously not forwarding the Nevertheless PHP-CLI should in general always be configured with |
I have the same issue when updating the php.ini to |
Did you check with Are you certain that the composer.phar does not actually use a different php binary to run composer? Can you check the contents of your composer.phar and see if it as perhaps a shim (e.g. a dummy file that calls another binary with some modifiers/flags/etc)? |
Yes, I've checked this. I can delete my composer.phar file and download a fresh copy to see if there is any difference... |
Doesn't change anything :/ |
I experienced the same issue this morning. Yesterday everything was fine, but today any attempt to run I think the problem might be with the source file at |
Same issue here, with Command with [composer 1.7-dev (089f380) 2018-05-15 14:07:13]: Results in: mmap() failed: [12] Cannot allocate memory
PHP Fatal error: Out of memory (allocated 3827302400) (tried to allocate 262144 bytes) in phar:///home/www/website/composer.phar/src/Composer/Autoload/AutoloadGenerator.php on line 926 The memory flag wasn't required before, and the server's memory was increased from 1Go to 3.5, without much success. I tried with both version of PHP 7.1.8-1ubuntu1 & 7.1.17-0ubuntu0.17.10.1 which resulted in the same. The only way to make the previous command work with the recente version of composer, is surprisingly to remove the I tried with the version 1.6.5 |
Pinging @Seldaek in if it's just occurring in dev branch. |
I think #7316 sounds like the culprit for the issue happening at autoload time with --no-dev. Might not handle circular dependencies well or something. That sounds unrelated to the memory issue initially reported in this issue though. |
Looking at that code: yes, circular dependency will most certainly make it run out of memory pretty quickly, it doesn't handle them whatsoever. |
I have the same problem. |
OK I found a solution : I was using WAMP 32bits, and switched to WAMP 64bits, that solved everything. |
We've been hit by this issue as well. But only if we use the latest composer dev version.
This uses all the the remaining memory and starts to swap. I can confirm that 22025f2 works ok. But since the merge of #7316 ( b0be871 ) it starts with the memory eating. 🍪 |
@dol @joshstoik1 @xlr-8 @imsheng can you please try again with the latest snapshot? Hopefully eedbd21 fixes it. |
I can confirm that eedbd21 fixes the issue. |
Did this on my linux box and it worked sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 |
That implies your development machine did not have any swap space to begin with, and it was simply running out of memory the hard way. |
i had the same problem and only @ealanisg 's solution fixed it |
As my comment above indicates: that's not so strange as it implies you were running a developer machine without a swapfile. That's suicide unless it has at least 16GB of RAM anyway. |
i had the same problem and only @ealanisg 's solution fixed it Thanks!!!! |
i had the same problem and only @ealanisg 's solution fixed it Tks very !!!! |
Yep, @ealanisg's fix works for me (I have a 1GB vps). Thanks. |
Swapfile works but you should optimize composer.json to use more explicit dependencies if possible. Sometimes pulling and comparing too many versions are responsible for increased memory consumption. |
In case anyone else comes across this and is stuck with a 32 bit version of php on Windows, this patcher worked for me https://ntcore.com/?page_id=371, I applied it to the php.exe and composer updated it no problems at all, memory usage was just a touch over 2GB. |
Given that all maintained Windows versions out there only have 64-bit versions and switching to a 64-bit build of PHP takes less than 5 minutes - how could you get stuck on a 32-bit version of PHP? |
@ealanisg tks brother! |
I solved this issue with a simple composer self-update. My memory_limit is set to 2G |
My project has been hold down cause of this issue : I have created an issue for the same error! But the issues closed and referenced to this page! |
Today is April 2 , Not april 1 @kleidi90
Here is what happend to me after self-update |
@devkbsc in your case, you don't reach the PHP memory limit. You reach the system memory limit. |
My system has enough memory space |
@devkbsc with all due respect, you should be reading up on basic computer knowledge if you're showing disk space numbers to prove you're not out of system memory. The difference is explained for example here concisely, or more thoroughly here. You should really be aware of such things before using software development tooling. |
self-update worked for me |
You may also get resolved by just removing vendor directory and re-execute composer install command. |
@curry684 I have found where the problem existed! ComposerSetup done! There are a file created by composer need to be placed in the project folder! it's composer.phar need to be synched each time i use composer command in CMD-windows! I got to understand this scenarie took months! Thanks for your fantastic guidence! |
@curry684 the comprehension sometimes depends on the terms we use in common ! In my knowledge "SYSTEM" is very common term uses for computer host |
Try Self-Update |
@ealanisg Thanks |
Thank you @ealanisg. Your solution works, does that mean our ubuntu didn't have a swap partition (ec2 server)? |
Hi, this solution will fix your problem. Update your php.ini file then restart Apache or your server It's work on me. |
Hi, closing my web-browser and any other memory expensive application fixed this for me. |
In my case, the solution is update composer |
i had the same problem and only @ealanisg 's solution fixed it Thanks!!!! |
Thank you @ealanisg it worked for me too, Actually it was given by the error in terminal : |
My
composer.json
:Output of
composer diagnose
:When I run this command:
I get the following output:
The text was updated successfully, but these errors were encountered: