Replies: 6 comments 1 reply
-
|
I don’t think this is a issue with payload. This might be something else using the ram. can you share you payload config and package.json ? |
Beta Was this translation helpful? Give feedback.
-
|
Hello, ok.here my payload config and package.json : Thanks for tips |
Beta Was this translation helpful? Give feedback.
-
|
Hi @bubbler3 — thanks for sharing the config 👍 Things to check first
Lowering |
Beta Was this translation helpful? Give feedback.
-
|
I have tried to log previously with following server.js code. // server.js i got :
I will check your tips in payload.config.ts and let you know : |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for detailed explanation. It helped me to dig around this issue. didnt work so well as the log still show a steaty growth
I understand that this issue with sharp / libvips is already documented. After images processing , memory is given back to the system allocator but not to the OS, counting still into the RSS, which is the one on which services as Railway are invoicing. I am testing 'sharp removal ' from Payload config currently but doing this stopped me from having the image processing/sizing enabled by sharp into payload. I need to wait a couple of days to confirm but already without sharp, memory went back to 200mb. As such behaviour of retaining memory is not considered a sharp bug and that only a restart can destroy the process and free the memory, this should be documented as a drawback of using Payload+Railway stack. I understand force Railway Auto-restart doesnt seem a long term solution but if i keep Sharp library, i didnt find any other command to ask Railway to restart. Do you know one? |
Beta Was this translation helpful? Give feedback.
-
|
ok, after testing without sharp package, the memory in production still progressively increased up from 200mb 800mb after 4 days, while the blog has almost no traffic and a couple of pages. so my only current adopted solution is to agressively restart every day with command : |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Using almost a payload template with less than 20 pages deployed to Railway with supabase database to store data:
"@payloadcms/next": "3.71.1",
"next": "15.4.10",
I can notice memory consumption goes from 200mb to more than 1gb in less than 3 days while the server being idle with almost no traffic. This causes Railways crashes and additional costs. I dont understand this memory adding up constantly and this seems to be due to a memory leak.
I have already discussed with Railway team trying following solution but with no positive results :
Using Railway variable environment :
NODE_OPTIONS : --max-old-space-size=256 causes then deployment afterward to fail with FatalProcessOutOfMemory
start": "cross-env NODE_OPTIONS='--max-old-space-size=300 --expose-gc --no-deprecation' node server.js".
The only temporary solution found is to restart the server every day to maintain the memory under 300mb otherwise it increases quickly.
Have someone met this issue?
Beta Was this translation helpful? Give feedback.
All reactions