Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory limit Exhausted #8063

Closed
devkbsc opened this issue Mar 27, 2019 · 13 comments
Closed

Memory limit Exhausted #8063

devkbsc opened this issue Mar 27, 2019 · 13 comments

Comments

@devkbsc
Copy link

devkbsc commented Mar 27, 2019

My composer.json:

{
    "name": "myname/symfony3",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "": "src/"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "^3.4.23",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3.10",
        "symfony/monolog-bundle": "^3.0.2",
        "symfony/polyfill-apcu": "^1.0",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "twig/twig": "^1.0||^2.0",
	"friendsofsymfony/user-bundle" : "~2.0@dev",
        "easycorp/easyadmin-bundle": "^1.16",
        "egeloen/ckeditor-bundle": "^5.0",
        "snpt/bootstrap-datepicker": "^3.0",
        "pugx/autocompleter-bundle": "^1.3",
        "tetranz/select2entity-bundle": "^2.9",
        "symfony/web-server-bundle": "^3.4",
        "symfony/serializer": "^3.4",
        "jms/serializer-bundle": "^2.4",
        "pinano/select2-bundle": "^4.0",
        "craue/formflow-bundle": "^3.1",
        "select2/select2": "^4.0",
        "twbs/bootstrap": "^4.0",
        "techlab/smartwizard": "^4.3",
        "knplabs/knp-paginator-bundle": "^3.0"
        

        
		
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0"
    },
    "scripts": {
        "symfony-scripts": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": null
    },
    
    "minimum-stability": "dev",
    "prefer-stable": true
}

Output of composer diagnose:

C:\xampp\htdocs\risym>composer diagnose
Checking composer.json: WARNING
Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.8.4
PHP version: 7.0.31
PHP binary path: C:\xampp\php\php.exe

When I run this command:

C:\xampp\htdocs\risym>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 117440512 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 90

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 117440512 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 90

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
C:\xampp\htdocs\risym>php -r "echo ini_get('memory_limit').PHP_EOL;"
-1

C:\xampp\htdocs\risym>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)

VirtualAlloc() failed: [0x00000008] Les ressources mÚmoire disponibles sont insuffisantes pour traiter cette commande.


VirtualFree() failed: [0x000001e7] Tentative dÆaccÞs Ó une adresse non valide.


VirtualAlloc() failed: [0x00000008] Les ressources mÚmoire disponibles sont insuffisantes pour traiter cette commande.


VirtualFree() failed: [0x000001e7] Tentative dÆaccÞs Ó une adresse non valide.

PHP Fatal error:  Out of memory (allocated 1635778560) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Out of memory (allocated 1635778560) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

I get the following output:

VirtualAlloc() failed: [0x00000008] Les ressources mÚmoire disponibles sont insuffisantes pour traiter cette commande.


VirtualFree() failed: [0x000001e7] Tentative dÆaccÞs Ó une adresse non valide.


VirtualAlloc() failed: [0x00000008] Les ressources mÚmoire disponibles sont insuffisantes pour traiter cette commande.


VirtualFree() failed: [0x000001e7] Tentative dÆaccÞs Ó une adresse non valide.

PHP Fatal error:  Out of memory (allocated 1635778560) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Out of memory (allocated 1635778560) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

And I expected this to happen: I use composer to install bundle which is encounting error
@alcohol
Copy link
Member

alcohol commented Mar 28, 2019

Allow Composer to use more memory.

@alcohol alcohol closed this as completed Mar 28, 2019
@devkbsc
Copy link
Author

devkbsc commented Apr 2, 2019

Frankly, i have tried in all ways you told @alcohol

@devkbsc
Copy link
Author

devkbsc commented Apr 2, 2019

https://www.chapterthree.com/blog/how-fix-composer-memory-issue i have did exactly the same! When i execute this command i get :

php -r "echo ini_get('memory_limit').PHP_EOL;" 

- 1

i tried also this command

C:\xampp\htdocs\risym>php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)

VirtualAlloc() failed: [0x00000008] Les ressources mÚmoire disponibles sont insuffisantes pour traiter cette commande.


VirtualFree() failed: [0x000001e7] Tentative dÆaccÞs Ó une adresse non valide.


VirtualAlloc() failed: [0x00000008] Les ressources mÚmoire disponibles sont insuffisantes pour traiter cette commande.


VirtualFree() failed: [0x000001e7] Tentative dÆaccÞs Ó une adresse non valide.

PHP Fatal error:  Out of memory (allocated 1405091840) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Fatal error: Out of memory (allocated 1405091840) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

@curry684
Copy link
Contributor

curry684 commented Apr 3, 2019

Increase your swap space. As explained elsewhere you are out of system memory so no matter how you configure PHP it's going to keep failing.

@iBobik
Copy link

iBobik commented Nov 13, 2019

Composer consumed more than 939 MB before it failed. If it is normal then this huge requirement should be mentioned in: https://getcomposer.org/doc/00-intro.md#system-requirements

@alcohol
Copy link
Member

alcohol commented Nov 14, 2019

Consumption is based on your dependency tree and constraints. It could be 10mb. It could be 2gb. 🤷‍♂️

@curry684
Copy link
Contributor

It's not huge. Development machines are generally considered to require at least 8GB, preferably 16GB of RAM to run memory-hungry development tools. Therefore 939MB is certainly not 'huge'.

Same goes for tools like MySQL - the minimum amount to run it is like 256MB of RAM, but it's not going to be running any kind of big database like this. Add RAM as required for use case. They don't document either that MySQL could usefully use up to hundreds of gigabytes.

@iBobik
Copy link

iBobik commented Nov 14, 2019 via email

@curry684
Copy link
Contributor

That's still beside the point, being that if you don't normally have 1GB of RAM to spare you really need more in your machine. Composer is not the only devtool soaking up peak capacity.

More or less offtopic but relevant - keep in mind that databases are usually intent on claiming ALL available RAM eventually in their host system, because it keeps them efficient. This is obviously not such a good idea on a development machine also running other services and IDEs, so you have to tell it explicitly not to. MySQL can run fine when constrained to 256-512MB of RAM actually, and you can easily configure that.

@geri777
Copy link

geri777 commented Feb 22, 2020

I have 16 GB Ram - 6 in use, so 9-10 GB free. Nonetheless I get this error at 1405091840 bytes.
I run composer with memory_limit=-1

@moderatoo
Copy link

"I have 16 GB Ram - 6 in use, so 9-10 GB free. Nonetheless I get this error at 1405091840 bytes.
I run composer with memory_limit=-1"

Me too!!
Any solutions?

@geri777
Copy link

geri777 commented Oct 13, 2020

@curry684
Copy link
Contributor

Run php -i | grep memory_limit to find the actual memory limit PHP is seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants