Composer killed when installing a module I am actually running Drupal on a LAMP (XUbuntu 20-04 with 4 GB RAM in VirtualBox)
At the beginning of the installation I had no problem with installing dependencies using composer
But since yesterday every composer command gets killed like in the following code (entity print installation):

igpde@igpde-VirtualBox:/var/www/html/d8igpde2$ composer require dompdf/dompdf
Using version ^0.8.6 for dompdf/dompdf
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed



I thought it could be a memory problem but in the php 7.4 client installation:

I read -1 should mean no limit



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


Any Id how I could solve this problem?

Thanks in advance for you suggestions

Running with the vvv flag:

igpde@igpde-VirtualBox:/var/www/html/d8igpde2$ composer -vvv require dompdf/dompdf | tee composer.log
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html/d8igpde2): git branch --no-color --no-abbrev -v
Executing command (/var/www/html/d8igpde2): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/var/www/html/d8igpde2): git log --pretty=&quot;%H&quot; -n1 HEAD --no-show-signature
Executing command (/var/www/html/d8igpde2): hg branch
Executing command (/var/www/html/d8igpde2): fossil branch list
Executing command (/var/www/html/d8igpde2): fossil tag list
Executing command (/var/www/html/d8igpde2): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /home/igpde/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ &quot;Getting Started&quot; section
Reading /var/www/html/d8igpde2/vendor/composer/installed.json
Loading plugin Drupal\Composer\Plugin\ProjectMessage\MessagePlugin
Loading plugin Drupal\Composer\Plugin\Scaffold\Plugin
Loading plugin Drupal\Console\Composer\Plugin\Extender
Loading plugin Composer\Installers\Plugin
Running 1.10.9 (2020-07-16 12:57:00) with PHP 7.4.3 on Linux / 5.4.0-42-generic
Downloading https://packages.drupal.org/8/packages.json
Writing /home/igpde/.cache/composer/repo/https---packages.drupal.org-8/packages.json into cache
Downloading https://repo.packagist.org/packages.json
Writing /home/igpde/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /home/igpde/.cache/composer/repo/https---packages.drupal.org-8/drupal-provider-2020-3.json from cache
Reading /home/igpde/.cache/composer/repo/https---packages.drupal.org-8/drupal-provider-2020-2.json from cache
Reading /home/igpde/.cache/composer/repo/https---packages.drupal.org-8/drupal-provider-2020-1.json from cache
...............................................
Reading /home/igpde/.cache/composer/repo/https---repo.packagist.org/provider-sabberworm$php-css-parser.json from cache
Killed



the preceding output is very long
It waits a lot of time before declaring Killed. looks like a time out!
except for the last reading every Reading ... happens fast
You ran out of memory. This happens all the time with Composer.
Composer is a huge memory hog, especially when used with Drupal because of all the external interdependencies. And Drupal's requirements continue to grow with every new release, so the memory needed to use Composer with Drupal continues to grow. 4Gb of available memory should be enough, currently, but 2Gb is not enough in my experience. I find this problem can be avoided if you configure your system with sufficient swap space (2x physical memory is usually sufficient). This is for a development system of course - you won't be using Composer to install modules like that on a production system, you should be using a .lock file instead, so Composer's memory requirement will be much smaller.