# Tracking Memory Leak or Consumption

**URL:** https://discourse.nodered.org/t/tracking-memory-leak-or-consumption/90403
**Category:** Developing Nodes
**Created:** [24 August 2024 22:48 UTC](https://discourse.nodered.org/t/tracking-memory-leak-or-consumption/90403 "2024-08-24T22:48:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JpEncausse](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jpencausse/32/2561_2.png) [@JpEncausse](https://discourse.nodered.org/u/JpEncausse)
#### Post date: [24 August 2024 22:48 UTC](https://discourse.nodered.org/t/tracking-memory-leak-or-consumption/90403/1 "2024-08-24T22:48:15Z")

</div>

Hello,

I'm working on a Framework (that will probably be opensource) to display a WebChat / LLM / ... I have 20 Nodes.

In some test I have a Prompt that produce a Huge JSON. I mean by huge it can be more than the 4K token limitations of ChatGPT. So I also implement the Streaming capabilities of LLM.

It seems my Node-RED go up to 2Gb very easily then becomes very slow or crash. So I was wondering :

- How can I track where the memory is consumed ?
- Is there some rule of thumb ?

In this specific case I don't think it is Node-RED itself because it seems to be in Azure OpenAI JS streaming library. But I don't know how to point that 🙂

I don't do a lot of optimisation. Don't know if there is some rules ?

- I keep trying to call node.send(,false) to avoind object cloning for intense work
- I also get MaxListenersExceededWarning: Possible EventEmitter memory leak detected. But it seems to be kept around 10. I use it for my WebChat communication.

---

<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: [23 October 2024 22:48 UTC](https://discourse.nodered.org/t/tracking-memory-leak-or-consumption/90403/2 "2024-10-23T22:48:39Z")

</div>

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