Tracking Memory Leak or Consumption

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 :slight_smile:

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.

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