1

I am trying to update some Drupal modules using Composer.

When I run composer outdated "drupal\*" to see what updates are available, it shows a list of modules requiring an update.

enter image description here

But when I run composer update <module-name> --with-dependencies it gives me a memory allocation error.

enter image description here

If I run it with sudo (not recommended, I know. But trying everything.), it does nothing. No error reported. Nothing.

enter image description here

I have tried composer clearcache already but it didn't help any. What am I doing wrong? Why is this so?

user1872371
  • 321
  • 2
  • 12
  • Looks like you try to run `composer update` on a cloud-based server with only little RAM. Don't do that, run these stuff on your development system where you are not constrained to such little memory – Nico Haase May 17 '20 at 16:01
  • Is it a recent change to composer memory requirements? I have updated this so many, many times before but never ran into this issue before? Does swap files have anything to do with it? – user1872371 May 18 '20 at 10:27
  • Not running Composer on a server with only little memory, but on your local machine, put `composer.lock` under version control, and only run `composer install` during development has been recommended for years – Nico Haase May 18 '20 at 10:29

1 Answers1

0

you can try COMPOSER_MEMORY_LIMIT=-1 <module-name> --with-dependencies this lets composer use as much memory as needed.

PH83
  • 127
  • 1
  • 12
  • I don't think it's a memory issue. I tried with -1, 1024M memory as well as 2048M. No difference. It says Killed before returning to command prompt. – user1872371 May 18 '20 at 14:11
  • you may need to take a deep dive into whats running on your server. i was able to find another thread where someone had the same issue but im not sure if the solution will work for you. [https://stackoverflow.com/questions/27634109/why-mmap-cannot-allocate-memory] – PH83 May 18 '20 at 19:51