0

I try memory_limit=-1 or 526M or 1000M, but showing same error repeated.Please help me!!!!

D:\xampp\htdocs\elevenMedia>composer require laravel/ui Using version ^2.0 for laravel/ui ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process t his command.

VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process t his command.

VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

PHP Fatal error: Out of memory (allocated 908066816) (tried to allocate 4096 by tes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Depen dencyResolver/Solver.php on line 223

Fatal error: Out of memory (allocated 908066816) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Dependency Resolver/Solver.php on line 223

candy layy
  • 37
  • 1
  • 4
  • please read this: https://stackoverflow.com/a/12178235/10573560 – OMR Jun 25 '20 at 15:43
  • @OMR the given answer does not help after all, as Composer does not use `mod_php` – Nico Haase Jun 26 '20 at 06:46
  • Does this answer your question? [Composer Update failed -- out of memory](https://stackoverflow.com/questions/33299302/composer-update-failed-out-of-memory) – Nico Haase Jun 26 '20 at 06:46

3 Answers3

0

You can try to increase de Memory Limit to 2 Gigabytes, as Laravel suggest, in your php.ini. On XAMPP it is located at C:\xampp\php\php.ini

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 2G
0

In my case, it was a problem with missing swap partition. More info: https://github.com/composer/composer/issues/7348#issuecomment-414178276

М.Б.
  • 1,308
  • 17
  • 20
-1

You can try installing this package that enables parallelization of the downloads.

composer global require hirak/prestissimo

Also when running your composer command use the -vvv flag if you are running into issues.

  composer require laravel/ui -vvv
Kurt Friars
  • 3,625
  • 2
  • 16
  • 29
  • 1
    Please add some further information to your answer. If dependency resolving does hot work, Prestissimo won't help after all – Nico Haase Jun 26 '20 at 06:45
  • 1
    Thank you so much!!! I solved my problem by your answer.Your comment is very helpful for me.Thank you guy. – candy layy Jun 26 '20 at 07:02
  • No problem! I find composer can be very finicky, and this helped solve my issue when I ran into it. Glad it helped! – Kurt Friars Jun 26 '20 at 07:09
  • @NicoHaase I am no expert here, but I think the parallelization somehow reduces the burden on memory usage. I know I was getting memory exhausted errors even with limit set to -1. Eventually I tried this, and it worked. – Kurt Friars Jun 26 '20 at 07:12
  • 1
    No. Prestissimo runs the downloads in parallel **after** dependencies have been resolved. If the resolving process fails (as shown in the error message: the solver runs out of memory), there is nothing to be downloaded in parallel – Nico Haase Jun 26 '20 at 07:17