Memory leak when custom image is deployed in cloudron
-
My issue is that I have a website which is a SvelteKit SSR app (Node based), locally the memory usage is stable, but when I deploy it on cloudron, it keeps climbing until it reaches the limit.
In the image below, you can see the memory balloons until it reaches the limit. (for the last test, I changed the limit from 256MB to 512MB)
I tried running the docker container locally, and the memory footprint (using
docker stats
) is stable at 116MB.What can I do to fix this memory leak?
-
Hi @ruihildt,
I haven't worked with sveltekit yet, but if you see the leak on Cloudron but not locally when using the same container, then I would think it must have to do with incoming requests. is it perhaps the healthcheck that generates this memory?
-
-
So the memory leak indeed seemed to be coming from the frequent health check.
I customized the health check path and returned a simple response object, and it seems to do the trick.I still think I have something incorrectly handled somewhere and if the website would have a lot of traffic, the issue would probably resurface.
But it's not very likely, so I'll stick to YAGNI. (I'll keep an eye on the stats in any case.)
Thanks for the help.
-
-