Node-red application gradually increases memory usage until crashing

Hi @nikhilkinkar,
I'm FAR from a memory expert.
But could it perhaps be of any help to:

  • Use my node-red-contrib-heap-dump node to create two heap dumps (with some time in between), and compare two heap dumps using an external tool (e.g. Chrome) to analyze the difference.

  • Start your Node-RED in debug mode and connect with a Chrome debugger to NodeJs (as I described here). Then you can go to the "Memory" tabsheet, and see the memory live or take heap dumps and compare them, and ...

    image

There are a lot of tutorials (like this one) available to describe how you can do that. So perhaps you have already tried this kind of analysis?

You talk about the node-red-contrib-opcua node. I don't know how it works, but perhaps it uses memory (e.g. C++) that is managed outside of the V8 engine (which is running NodeJs and manages all NodeJs memory). In that case perhaps you won't find anything using heap dumps. But it is just an assumption ...

Good luck with it!
Bart