0

I have a NodeJS application that wraps a large obfuscated JavaScript file and utilizes it to run computations. The issue is the JavaScript file has a memory leak, and required fairly frequent restart to clear the memory. Currently I am using a systemd to kill and restart the process when it hits a specific memory usage, and while this works enough... its not ideal. I have been moving many other applications into docker because, awesome, and am wanting to try and tackle both tasks together but I am struggling to find a graceful way to accomplish this.

Ideally I would like to get the application to gracefully and seamlessly restart as soon as it crosses over a certain memory threshold and it becomes idle. I have been pouring over the docker website and can't find anything that specifically support this case. PM2 does allow for this but there seems to be a general sentiment across stack overflow (and a couple blogs) mixing them is 99.99% of the time a bad idea, but I wanted to try and do a sanity check to ensure I am not overthinking this.

0

You must log in to answer this question.

Browse other questions tagged .