N8n keeps crashing due to memory leaks in long-running HTTP workflows

i am currently running n8n 1.22..0 in docker (4GB memory limit)
The workflow: webhook-> 5 parallel HTTP requests β†’ Postgres insert
then after 48 hours the node will crash with this particular error

FATAL ERROR: javaScript heap out of memory 

the memory will then grow up to like 50MB per hour then crashes again
i have tried increasing node.js memory limit and it only delays the the crash

1 Like

Good day kulang it is nice hearing from you,
The permanent solution for the crashing due to memory leaks is just upgrade to n8n 1.23.8+ which includes automatic cleaning,
bette memory management ,
and fix for Axios,
in the future to prevent this problems just monitor memory with n8n’s built in metric endpoints
also set up kubernetes health checks to restart pods before crashes,
and break long workflows into smaller chunks too.

please don’t forget to hit the solution button if i solution acutally worked for you thanks

2 Likes

thank you sir , i would upgrade now , i was also thinking as much

1 Like