Question: I got this error when running `composer.phar update` on my VM:

> 
> PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 144115188075867549 bytes) in phar:///bin/composer.phar/src/Composer/Util/RemoteFilesystem.php on line 179
> 
> 
> 

The `composer.json`, if needed:

```
{
        "description" : "The CodeIgniter framework",
        "name" : "codeigniter/framework",
        "license": "MIT",
        "require": {
                "php": ">=5.2.4",
                "videlalvaro/php-amqplib": "2.5.*"
        },
        "require-dev": {
                "mikey179/vfsStream": "1.1.*",
                "videlalvaro/php-amqplib": "2.5.*"
        }
}

```

The VM just recently recovered from a bad disk sector problem, and the guy running the VM said that the VM has been moved to a new disk. There are only Java, PHP, httpd, postgre, rabbitmq and the website itself in my VM, and it already ran perfectly for about 4 months before this happened. I'm using PHP 5.6.11. Can anyone help please?

Answer: 
Rather than permanently setting your memory limit to an increased number (or unlimited), I use this;

```
# Running an update
COMPOSER_MEMORY_LIMIT=-1 composer update

```

```
COMPOSER_MEMORY_LIMIT=-1 composer require PACKAGE/NAME

```

That temporarily set's the composer memory limit env variable to unlimited.
If you are running into composer memory problems, now your best option is probably to use composer v2, if you can.

Composer v2 has many performance improvements and as a result, it takes much less memory.

I was always having to use `COMPOSER_MEMORY_LIMIT=-1 composer update` but after the v2 update, I no longer need to use this.

Check out the release announcement <https://blog.packagist.com/composer-2-0-is-now-available/> or download the latest version <https://getcomposer.org/download/>