Skip to content

Memory error when executing cache:clear after installing friendsofsymfony/jsrouting-bundle #487

Open

Description

@ahmed-bhs

Hey there! 👋

I hope you’re doing well! I wanted to reach out because I'm facing a bit of a challenge after installing the friendsofsymfony/jsrouting-bundle in my Symfony 6.4 project. I've tested both versions 3.0.0 and 3.5, but I'm running into a snag.

Whenever I run the cache:clear command, I get hit with the following error message:

Script cache:clear returned with error code 255

// Clearing the cache for the dev environment with debug true

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php on line 124

Additional Details:

Symfony Version: 6.4
FOS JS Routing Bundle Version: Tested 3.0.0 and 3.5
Symfony Framework Bundle Version: 6.4.8
PHP Version: 8.2
Environment: Development
PHP Configuration:
    Allocated Memory: 128 MB

Steps to Reproduce the Issue:

Install the friendsofsymfony/jsrouting-bundle (version 3.0.0 or 3.5).
Remove Vendor
Run composer install.
Execute php bin/console cache:clear.

Activity

  1. Crovitche-1623 commented on Nov 12, 2024

    @Crovitche-1623

    @ahmed-bhs Increase the memory_limit in your php.ini file because 134217728 bytes is only ~ 0.13 gb of memory.

  2. ahmed-bhs commented on Nov 12, 2024

    @ahmed-bhs
    Author

    Oh, thank you @Crovitche-1623 ! Do you have any recommendations for the PHP memory limit value to set?

  3. Crovitche-1623 commented on Nov 12, 2024

    @Crovitche-1623

    The higher the better. However, make sure it's no more than your system has RAM for. 1 gb should be more than enough for an ordinary website.

  4. Crovitche-1623 commented on Nov 12, 2024

    @Crovitche-1623

    @ahmed-bhs Moreover, you can install the Symfony CLI (it's just a tool) to check if your system meets all the requirements to run a Symfony App (it also checks variables in php.ini and give you tips about what you should modify).

    https://symfony.com/download

    Then, once the CLI is installed, run : symfony check:requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions