I have a memory leak in a Node.js, and I'm working on trying to find it but it's currently deployed to Heroku. I'd like to currently have something that would restart the process once it reaches a certain size in memory (especially since I have a few dynos running).
Do you use PM2 to run your app? If yes there's a good config option that fits your need called max_memory_restart
.
http://pm2.keymetrics.io/docs/usage/monitoring/#max-memory-restart
Not finding a solution I created a npm utli lib that does that. Please note it does not work on windows though.
It's based on cluster and status npm libs.
http://github.com/DoryZi/memory_limiter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With