I'm building a nodeJS app which purpose is to convert documents to images. As a consequence, it's pretty heavy on RAM, so when there is a peak I can go up to 100% RAM usage on my server.
My problem is that when it happens, node crashes (out of memory exception), so I'd like to find a way for it not to crash and just do its job "as well as it can".
I know there are alternatives (scaling, queuing, using 'forever' to bring it back up automatically), and am working on that, but in case something fails, it would be cool to know that my server will not just die if RAM happens to be full.
Is there a way to achieve that ?