0

Getting this error on "composer require drupal/module-name". I want to install a module on my drupal site but it always returns me this error.

VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.


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


VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.


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


Fatal error: Out of memory (allocated 1711276032) (tried to allocate 4096 bytes) in 
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on 
line 223
Someshver Thakur
  • 162
  • 1
  • 11
  • 1
    Does this answer your question? [Composer Update failed -- out of memory](https://stackoverflow.com/questions/33299302/composer-update-failed-out-of-memory) – Nico Haase Oct 09 '20 at 06:17

2 Answers2

0

Update on your php.ini file's: memory_limit= XXXM

Replace XXXM value by the memory that you wanna allocate.

Or replace XXXM by -1 to negate memory limit condition.

Sharklalu
  • 339
  • 1
  • 8
  • Are you sure that you edit the right php.ini file? if you execute : php -r "echo ini_get('memory_limit').PHP_EOL;" Did your memomy limit change? – Sharklalu Oct 12 '20 at 10:23
  • Yes i am pretty sure about the memory limit. – Someshver Thakur Oct 12 '20 at 10:58
  • Did you restarted your server. Did your memomy limit change after this? If it persists, do as @ Nico-hasse said and check [composer-update-failed-out-of-memory](https://stackoverflow.com/questions/33299302/composer-update-failed-out-of-memory) – Sharklalu Oct 12 '20 at 11:56
0

Virtual memory Error on composer run Solution (Windows)

  1. Download PHP 7.3+ and place on a folder on c drive
  2. Change the environment variable path of PHP to new php
  3. Set the memory limit to -1 in PHP 7.3+ ini file Also uncomment the required extensions.
  4. Run Composer
Someshver Thakur
  • 162
  • 1
  • 11