Bun potential memory leak

I have a service running the latest version of Bun. It’s a simple express.js application and over the course of a day or several days, i notice the memory usage going up even when the service isn’t being used, it’ll go up a megabyte or 2 every few hours. then once it gets to about 120MB of usage, the server restarts automatically and it’ll stay at roughly 75MB of usage at the start and then start increasingly going up over the days . I’m on the 512MB paid plan. I imagine because render hits the health endpoint every so often, somehow it’s causing memory usage to go up simply based on that endpoint being hit. i could be wrong, just trying to figure out what’s going on.

Hi there,

While it could be a memory leak in Bun, I think it is more likely to be the memory usage of your code/dependencies causing the memory to go up. You are right, our health checks are constantly making requests to your service, which could cause your memory usage to increase.

If your service were hitting our memory limits, you would see it recording unhealthy events which indicate that it hit the memory limit. If you don’t see this, this isn’t the reason for the restart.

From a community post, we can specifically look at your Render service, so you be way forward would be to contact Render support directly from the Contact Support link in our dashboard.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.