Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[BUG] Memory leak on API upsert request

Open cuca24 opened this issue 9 months ago • 8 comments

Describe the bug When i use API request to upsert document to vector store i get memory leak, For 3k items it usses additional 5GB of ram and it doesn't free up. It fills up memory until PC crashes.

I setup TextFile and enabled API and enabled Override Configuration for text file. I'm sending this file via API curl requests from another system

To Reproduce here is simple flow that leaks

Image

Expected behavior Memory would free up after some time

Setup

  • Installation docker,
  • Flowise Version latest
  • OS: [Linux]

cuca24 avatar May 22 '25 06:05 cuca24

Can you try using the Document Store Upsert API? https://docs.flowiseai.com/using-flowise/document-stores#upsert-api

HenryHengZJ avatar May 22 '25 08:05 HenryHengZJ

I already tried with document store, but i really don't need to have additional store for the data. I just need to send the data to vectore store in one go, which does works nicely by sending text, but unfortunately over time it leaks memory.

This is might connected: https://github.com/FlowiseAI/Flowise/discussions/3733 I tried to use @bernejorge image but it just won't start the container.

cuca24 avatar May 22 '25 20:05 cuca24

I already tried with document store, but i really don't need to have additional store for the data. I just need to send the data to vectore store in one go, which does works nicely by sending text, but unfortunately over time it leaks memory.

This is might connected: #3733 I tried to use @bernejorge image but it just won't start the container.

I see a similar memory leak issue with Custom MCPs, losing around 150MB every time you add a Custom MCP node (even deleting all flows will not relase it). Over time, during iterative testing, memory consumption can escalate to around 3 or 4 GB easily.

The only way I found to reclaim the leaked memory was by restarting the Flowise container via the implementation of a cron job on the host server to automate the restart process.

toi500 avatar May 23 '25 14:05 toi500

I already tried with document store, but i really don't need to have additional store for the data. I just need to send the data to vectore store in one go, which does works nicely by sending text, but unfortunately over time it leaks memory. This is might connected: #3733 I tried to use @bernejorge image but it just won't start the container.

I see a similar memory leak issue with Custom MCPs, losing around 150MB every time you add a Custom MCP node (even deleting all flows will not relase it). Over time, during iterative testing, memory consumption can escalate to around 3 or 4 GB easily.

The only way I found to reclaim the leaked memory was by restarting the Flowise container via the implementation of a cron job on the host server to automate the restart process.

that was already resolved with the fix https://github.com/FlowiseAI/Flowise/pull/4375 no?

HenryHengZJ avatar May 28 '25 11:05 HenryHengZJ

that was already resolved with the fix #4375 no?

No, you leave it open for further investigation https://github.com/FlowiseAI/Flowise/issues/4369#issuecomment-2853106883

toi500 avatar May 28 '25 12:05 toi500

Hi, facingg same issue in agent v2, for sequential agentflow, any update ?

AbhishekHupele avatar Sep 22 '25 08:09 AbhishekHupele

no database connecttion is thr in our flow, it is coming in agent v2 sequential workflow , llm calls

AbhishekHupele avatar Oct 16 '25 06:10 AbhishekHupele

I can confirm tha PR #5315 fixes this original issue. But it seems like there are more memory issues. It might be worth to create another issues with flow examples and more info on how to reproduce the issue @AbhishekHupele @toi500 cc: @HenryHengZJ

cuca24 avatar Oct 20 '25 06:10 cuca24