I don't know how to solve this problem but i found something here. https://getcomposer.org/doc/articles/troubleshooting.md you can check the memory limit section.
Jun 24, 2020
4
Level 8
I got composer memory lack error on my ubuntu 16
Hello, In my laravel 5 app I installed spatie/browsershot and after that got memory lack error on my ubuntu 16, under Digital Ocean
I rebooted OS and attached swap memory but memory lack error anyway:
# free
total used free shared buff/cache available
Mem: 1015908 175784 530992 25336 309132 662096
Swap: 0 0 0
root@ubuntu-boxBooking-Dev:~# sudo -s
root@ubuntu-boxBooking-Dev:~# sudo fallocate -l 1G /swapfile
root@ubuntu-boxBooking-Dev:~# sudo mkswap /swapfile
mkswap: /swapfile: warning: wiping old swap signature.
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=76e8a9d1-2d9c-4a3b-a7af-cd152d03532c
root@ubuntu-boxBooking-Dev:~# sudo swapon /swapfile
swapon: /swapfile: insecure permissions 0644, 0600 suggested.
root@ubuntu-boxBooking-Dev:~# sudo swapon -a
root@ubuntu-boxBooking-Dev:~# free
total used free shared buff/cache available
Mem: 1015908 176972 528020 25336 310916 660980
Swap: 1048572 0 1048572
root@ubuntu-boxBooking-Dev:~# cd /var/www/html/the-box-booking
root@ubuntu-boxBooking-Dev:/var/www/html/the-box-booking# mc
root@ubuntu-boxBooking-Dev:/var/www/html/the-box-booking# composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
mmap() failed: [12] Cannot allocate memory
Killed
root@ubuntu-boxBooking-Dev:/var/www/html/the-box-booking# lsb_release -d; uname -r; uname -i
Description: Ubuntu 16.04.4 LTS
4.4.0-184-generic
x86_64
php -v
PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 8 2019 15:37:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
I do not have a lot of packages in my composer.json :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"arrilot/laravel-widgets": "^3.13",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"mews/purifier": "^2.1",
"phpoffice/phpspreadsheet": "^1.6",
"proengsoft/laravel-jsvalidation": ">2.2.0",
"s-ichikawa/laravel-sendgrid-driver": "^2.0",
"spatie/browsershot": "^3.37",
"yajra/laravel-datatables-oracle": "~8.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
I suppose that I need to increase memory of my ubuntu instance ( Digital Ocean ). I have a cheapest instance options, as the app has not a lot of data/load. How many of memory do I need? How better to increase options of my ubuntu instance ? I do not like to overpay for the memory I really do not need.
Thanks!
Please or to participate in this conversation.