You can get this error while executing the composer require
command (e.g. on the Step 8 of the Mage2.PRO installation instruction):
The error is caused by a wrong PHP memory_limit
option value.
You can check it from the command line:
php -i | grep memory_limit
You will see something like:
As you can see, the memory_limit
value is 512 megabytes, but Magento 2 requires 2GB:
Upgrading the Magento applications and extensions you obtain from Magento Marketplaces and other sources can require up to 2GB of RAM. If you are using a system with less than 2GB of RAM, we recommend you create a swap file; otherwise, your upgrade might fail.