Memory Leaks in Node-RED

Hello everyone,

Im currently in the works of an experiment in which i encounter some issues with memory. The flow/code is memory leaking somewhere and the JS heap gets full. Is there any memory profiling tool that can be helpful in order to detect issues to memory ? Im using Node-RED Docker installation btw

Thanks in advance!

edit:

Here are the logs from Node-RED

1 Like

Welcome to the forum @pekoto4349

Start by checking the stacktrace carefully. It may give you a clue to what is wrong.
In future please if you want to post logs or the trace use copy/paste rather than screenshot. Thanks.

1 Like

Hi @pekoto4349,
If the memory is managed by the V8 engine, then you could e.g. take two heap dumps and compare them (see here). Then hopefully you can determine where the memory is allocated.
Barr

Hey @BartButenaers thanks for the tip! i will try using heap-dump and keep this thread posted if a solution comes up. Cheers!

@pekoto4349,
You can also use the node-red-contrib-inspector node to put your NodeJs in debug mode, and then connect with Chrome developer tools to it.
I have written some time ago a tutorial about doing something similar for cpu profiling. Of course you can do the same for memory profiling: go to the "Memory" tab instead, so you have the option to take different kind of heap snapshots. In your case record a heap profile inclusive stack traces might be useful to figure out where memory gets allocated..

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.