How to resolve out of memory issue on composer

Pasan Gamage
May 25, 2021

If you are running a Linux system you can do a memory swap first.

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024sudo /sbin/mkswap /var/swap.1 && sudo /sbin/swapon /var/swap.1

After above two commands are executed you can run below composer command freely.

php -d memory_limit=-1 /usr/bin/composer require 'drush/drush:9.0'

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Pasan Gamage
Pasan Gamage

Written by Pasan Gamage

Backend Developer | Motorbike enthusiast

No responses yet

Write a response