Recovering Nerdaholic
Recovering Nerdaholic

Reputation: 707

composer runs out of memory, cannot work around

I'm trying to install dependencies for a PHP command line tool with composer (installed in cygwin), but it runs out of memory no matter what I do.

I've increased memory_limit in php.ini to 2G

I've tried running php -d memory_limit=2G composer.phar with

I've tried removing the limit altogether with php -d memory_limit=-1 composer.phar ...

It keeps thinking it only has 64M of RAM available to it: Fatal error: Out of memory (allocated 68681728) (tried to allocate 2147215 bytes)

This machine as 24GB of RAM.

Upvotes: 2

Views: 777

Answers (2)

ttk
ttk

Reputation: 417

I just ran into this issue and my guess is that it's some sort of bug in 32-bit cygwin's version of php. I ran a very simple test script that allocated memory at different sizes. When the allocation size is small, say less than 2MB, then I can allocate up to the memory_limit. When the allocation size is slightly larger, say 6MB or more, it fails.

Upvotes: 0

Recovering Nerdaholic
Recovering Nerdaholic

Reputation: 707

Thanks to matzeri, the 64-bit cygwin seems to have done the trick. Oddly, though, composer on 32-bit cygwin always ran out at only 64MB.

Upvotes: 1

Related Questions