Allowed memory size of [X] bytes exhausted #55778
-
Hi everyone, I’m currently working on a Laravel project using: I’ve run into an issue where running php artisan config:cache causes my Pest test suite to fail with a memory exhausted error. The error only occurs after caching the configuration — without running config:cache, all tests pass normally. Steps to Reproduce: Result: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Have you tried to recreate this with a trivial project? Because if not, then my guess is that your app / tests are using a lot of memory and caching the config (which means holding it in memory rather than on disk) is just tipping your app (which is already close to full memory) over the edge of its memory limit. |
Beta Was this translation helpful? Give feedback.
@Sophist-UK Thank you for your reply. I’ve figured out that in the testing environment, Laravel uses the .env.testing file, but when config:cache is run, it actually caches values from the default .env file instead. That seems to be the root of the issue.