misd-service-development / phone-number-bundle

Integrates libphonenumber into your Symfony2-Symfony4 application
459 stars 143 forks source link

Pulling in misd/phone-number-bundle with composer is causing memory limit to be exhausted #192

Open crmpicco opened 5 years ago

crmpicco commented 5 years ago

I have narrowed down a memory issue in my application to the inclusion of the misd/phone-number-bundle dependency.

I am running a Symfony 3.4 application and when I try and pull in this dependency now I get the following error:

composer require misd/phone-number-bundle
Using version ^1.3 for misd/phone-number-bundle                
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)                  
PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.7.2/bin/composer/src/Composer/DependencyResolver/Solver.php on line 220

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.7.2/bin/composer/src/Composer/DependencyResolver/Solver.php on line 220

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

I can, of course, run composer with no memory limit - but I never used to have to do that until today.

cat /usr/local/etc/php/7.2/php.ini | grep -i memory_limit
memory_limit = 400M

composer --version
Composer version 1.7.3 2018-11-01 10:05:06

My full composer.json looks like this:

{
    "name": "crmpicco/golf",
    "license": "proprietary",
    "type": "project",
    "description": "CRMPicco Symfony 3.4 application",
    "autoload": {
        "psr-0": {
            "": "src/",
            "SymfonyStandard": "app/"
        },
        "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
    },
    "autoload-dev": {
        "psr-4": { "": "Tests/" }
    },
    "require": {
        "php": ">=7.2",
        "ext-dom": "*",
        "ext-libxml": "*",
        "ext-json": "*",
        "symfony/symfony": "3.4.*",
        "doctrine/orm": "~2.6",
        "doctrine/dbal": "2.7.2",
        "doctrine/common": "2.8.1",
        "doctrine/doctrine-bundle": "~1.9",
        "doctrine/migrations": "1.5.*",
        "doctrine/doctrine-migrations-bundle": "1.3.*",
        "twig/extensions": "~1.0",
        "twig/twig": "2.4.4",
        "symfony/monolog-bundle": "^3.1.0",
        "sensio/distribution-bundle": "~5.0",
        "sensio/framework-extra-bundle": "^5.0.0",
        "incenteev/composer-parameter-handler": "~2.0",
        "aws/aws-sdk-php": "3.*",
        "symfony/validator": "~3.0",
        "twilio/sdk": "~5.6",
        "plivo/plivo-php": "v4.1.2",
        "friendsofsymfony/user-bundle": "2.1.*",
        "friendsofsymfony/oauth-server-bundle": "~1.6.0",
        "guzzlehttp/guzzle": "^6.0",
        "fluent/logger": "~1.0.0",
        "egulias/email-validator": "^2.1",
        "knplabs/knp-paginator-bundle": "^2.8",
        "slot/mandrill-bundle": "v1.1",
        "braintree/braintree_php": "~3.16",
        "ekino/newrelic-bundle": "^2.0",
        "drewm/mailchimp-api": "^2.5",
        "symfony/polyfill-iconv" : "~1.0",
        "aws/aws-php-sns-message-validator": "^1.5",
        "zendesk/zendesk_api_client_php": "^2.2",
        "craue/config-bundle": "dev-master#0c662d8b9af5",
        "moneyphp/money": "^3.0",
        "chargebee/chargebee-php": "^2.5",
        "misd/phone-number-bundle": "^1.3"
    },
    "require-dev": {
        "symfony/maker-bundle": "^1.8",
        "phpunit/phpunit": "^7.0",
        "doctrine/data-fixtures": "dev-fixSorter as v1.2.1",
        "doctrine/doctrine-fixtures-bundle": "^3.0"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/REDACTED/data-fixtures"
        }
    ],
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\\Composer::hookRootPackageInstall"
        ],
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-bin-dir": "bin",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}

If I remove the phone-number-bundle there is no memory limit error and composer completes as expected.

Has there been a recent change to this bundle that could cause a memory issue?