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 error when executing cache:clear after installing friendsofsymfony/jsrouting-bundle #487

Open
ahmed-bhs opened this issue Oct 10, 2024 · 5 comments

Comments

@ahmed-bhs
Copy link

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.
@Crovitche-1623
Copy link

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

@Crovitche-1623
Copy link

@ahmed-bhs
Copy link
Author

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

@Crovitche-1623
Copy link

Crovitche-1623 commented Nov 12, 2024

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.

@Crovitche-1623
Copy link

Crovitche-1623 commented Nov 12, 2024

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants