My server crashes every few days because the memory hits capacity

Hello,

My server seems to crash every few days due to memory running out. You can see it crashes once I hit the memory capacity of my server.


It’s an express app in node. As far as I can tell there are no obvious memory leaks. No listeners, no global vars, etc. How can I approach understanding if this an issue with my code or if this is expected? I can’t seem to find any obvious way to debug this.

Thank you,
Evan

Hey,

As we communicate through this space, my visibility into your application and service on Render is limited. Consequently, there isn’t much we can offer in terms of debugging memory-related issues. We don’t run any specific memory profiler on your instance that could provide detailed insights into what is consuming all the memory. Our suggestions can only be based on assumptions derived from your code or usage patterns.

If you’re keen on thoroughly investigating this issue and understanding your memory consumption, I recommend running a memory profiler that’s compatible with your programming language or framework.

Based on the graph you’ve shared, it does appear to look like a memory leak, although I cannot be 100% sure. It might also be a gradual increase in usage over time. You should review your code for any unexpected loops or instances of light recursion, etc., that could be contributing to the issue.

Also, to mitigate this… consider deploying multiple workers and/or instances. This approach can help ensure that even if a worker instance crashes due to OOM errors, your application continues to serve traffic.

Jérémy.
Render Support, UTC+3

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