# About node-red memory handling

**URL:** <https://discourse.nodered.org/t/about-node-red-memory-handling/22643>\
**Category:** General\
**Created:** [5 March 2020 04:58 UTC](https://discourse.nodered.org/t/about-node-red-memory-handling/22643 "2020-03-05T04:58:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fangzhu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fangzhu/32/5796_2.png) [@fangzhu](https://discourse.nodered.org/u/fangzhu)\
**Post date:** [5 March 2020 04:58 UTC](https://discourse.nodered.org/t/about-node-red-memory-handling/22643/1 "2020-03-05T04:58:19Z")

</div>

I have a question about memory handling.  
Assuming we have a node that uses a lot of memory (through msg.payload object), when will the memory be cleared and by who? Would the used memory be cleared after the node is completed or flow is completed?

---

<div class="post-metadata">

**Author:** ![unixneo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/unixneo/32/17441_2.png) [@unixneo](https://discourse.nodered.org/u/unixneo)\
**Post date:** [5 March 2020 06:27 UTC](https://discourse.nodered.org/t/about-node-red-memory-handling/22643/2 "2020-03-05T06:27:32Z")

</div>

This might get you started:

> **[Node.js Garbage Collection Explained | @RisingStack](https://blog.risingstack.com/node-js-at-scale-node-js-garbage-collection/)**
>
> Learn how Node.js garbage collection and memory management works in practice. Code-level explanation and garbage collection examples inside.

---

<div class="post-metadata">

**Author:** ![fangzhu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fangzhu/32/5796_2.png) [@fangzhu](https://discourse.nodered.org/u/fangzhu)\
**Post date:** [19 March 2020 03:01 UTC](https://discourse.nodered.org/t/about-node-red-memory-handling/22643/3 "2020-03-19T03:01:00Z")

</div>

Thanks for providing the guide.  
Does Node-RED have a mechanism to limit, extend, monitor memory usage on top of Node.js?  
For example, if I want to understand which node in my flow use-up most of memory, or if I want to check memory leak, is there a good practice to do so?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [19 March 2020 09:33 UTC](https://discourse.nodered.org/t/about-node-red-memory-handling/22643/4 "2020-03-19T09:33:57Z")

</div>

HI @fangzhu

Node-RED doesn't provide anything above what is provided by the base Node.js runtime. There is no easy way for us to say "Node A is using X amount of memory".

With regard diagnosing Memory Leaks, I don't have any specific tips for you. It's an area I've not played with a huge amount. There certainly are tools out there that can help. For example, Clinic.js from Nearform looks very interesting - [https://clinicjs.org/](https://clinicjs.org/) - but I've not had a chance to play with it yet.

Nick

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 May 2020 09:43 UTC](https://discourse.nodered.org/t/about-node-red-memory-handling/22643/5 "2020-05-18T09:43:24Z")

</div>

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