node-red-contrib-heap-dump 0.0.1

A Node Red node to create a heap dump file

npm install node-red-contrib-heap-dump

A Node Red node to create a heap dump file.


Run the following npm command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-heap-dump

Node Usage

When talking about garbage collections in NodeJS, the collections are executed in the V8. That V8 is Google's Javascript engine (written in C++), that is a.o. used to run Node.js.

In normal circumstances, the V8 engine will cleanup memory (using garbage collections) as soon as necessary. But sometimes the garbage collections run frequently, but they don't cleanup all unused data from memory. Some memory keeps being allocated, despite it is not being used anymore. As a result, the memory usage start increasing... This situation is called memory leakage.

To find the root cause of a memory leak, you will need to compare multiple heap dumps (e.g. using the Chrome developer tools). This analysis process isn't explained here, because tons of tutorials about it can be found on the internet.

A heap dump is a snapshot of the NodeJs heap memory at a certain moment in time. This node simplifies the process of creating heap, since it is fully integrated in your Node-Red flow:

  1. Specify a directory in the node's config screen, where the heap dump file <timestamp>.heapsnapshot will be generated.

  2. Inject a message into the heap dump node. When no directory has been specified in step 1, a directory can be specified in the input message (using the field).

  3. The node status will indicate that the node is currently creating a heap dump:

    Trigger heap dump

  4. When the heap dump is finished, the node status will display the full path of the heap dump file:

    Heap dump done

  5. Execute some actions in Node-Red, preferable actions that you suspect causing the memory leak.

  6. Create on or more extra heap dumps, i.e. repeat steps 1 to 4 a number of times.

  7. Compare the heap dumps, e.g. using Chrome developer tools.

  8. Analyze the delta between the heap dumps ...

Example flow:


Node Info

Version: 0.0.1
Updated 3 months, 2 weeks ago
License: Apache-2.0


0 in the last day
2 in the last week
16 in the last month


  • heap-dump


  • node-red
  • heap
  • dump
  • memory


  • bartbutenaers