Composer: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
Composer ran out of memory while resolving or installing dependencies.
Seen on:
PHP
Meaning
Dependency resolution can need several GB on large projects, more than the CLI memory_limit or the server’s RAM allows.
Common causes
- CLI memory_limit too low
- Small VPS without swap
- Composer 1 (much more memory hungry than Composer 2)
- Running
composer updateon production
⚡ Quick fix
COMPOSER_MEMORY_LIMIT=-1 composer install- Upgrade to Composer 2:
composer self-update --2 - Run
composer updatelocally and commit composer.lock; onlycomposer installon servers
Detailed fix by platform
Linux
- Add swap on small servers before installing
How to diagnose
- Command — install or update?
- Version — composer --version
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026