A project I've made with Meteor has a memory leak that slowly accumulates over the course of a month or two. After sinking days into finding the leak, I'm throwing in the towel in favor of just adding an auto-restart that happens once a month. Yes this is bad practice, etc.
Is there a way to simply restart from within the server's codebase? Ideally this will also trigger a refresh for connected clients (similar to regular deployment updates).
Then I assume this command could just be nested in a good old JS timeout function.
You can also use the sudo killall -9 node command to stop all meteor projects and then meteor to start the one you want in your folder of choice.
On OSX, go back to the term you opened to start meteor, and use CTRL + C to quit the process.
meteor run You can use the application by pointing your web browser at localhost:3000. No Internet connection is required. This is the default command. Simply running meteor is the same as meteor run .
Meteor uses data on the wire, meaning the server sends data, not HTML, and the client renders it. Meteor embraces the ecosystem, bringing the best parts of the extremely active JavaScript community to you in a careful and considered way.
The answer provided by apendua worked. It's a total hack, and not recommended for most cases, but great for long-term memory leaks.
Put this inside your startup script:
var restartFrequency = 1000 * 60 * 24; // 1 day (1000 millsec * 60 min * 24 hour)
setTimeout(function(){
process.exit();
}, restartFrequency);
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