ahmedde wrote a reply+100 XP
1mo ago
I second that! The docs are missing too much, especially if you are using Laravel as API only. You have to google lots of obvious stuff that is not in the docs.
ahmedde started a new conversation+100 XP
3mos ago
Hi,
We're running a production app using Octane (Swoole) on Forge.
I have been getting few Sentry reports on memory leakage exceptions once every few days on random API routes. The exceptions are neither happening on consistent times or routes, which makes this difficult for me to find the piece that break the puzzle.
Example:
Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes)
I have checked the routes at which the exception is thrown, and there is nothing on them that may produce Octane memory leak. Some of them is very primal API routes that doesn't do much work.
For context, we're using Laravel as an API, a Filament dashboard, and we cache lots of stuff, but the cache is on Redis. The overall server memory usage never exceeds 40%.
From the logs, the error is coming from these sources. I understand Redis is involved, but I don't understand why.
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 356352 bytes) in /home/forge/x/vendor/predis/predis/src/Connection/StreamConnection.php on line 346
INFO {"status":500,"message":"Allowed memory size of 268435456 bytes exhausted (tried to allocate 356352 bytes)","errors":[]}.
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes) in /home/forge/x/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php on line 488
INFO {"status":500,"message":"Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes)","errors":[]}.