Bug Report: Memory Leak in Next.js 14.2.14 Dev Server
Answered
remib18 posted this in #help-forum
remib18OP
Hi,
I’m working on a side project with the latest stable version of Next.js (14.2.14) and encountered a significant memory leak (~10GB) that causes the process to be killed by macOS.
This issue arises when calling a server action within a client context (in my case, using Tanstack Query's useMutation). After the leak occurs once, it persists even after restarting the dev server, forcing me to reboot my machine.
Let me know if you need more information.
Thanks!
I’m working on a side project with the latest stable version of Next.js (14.2.14) and encountered a significant memory leak (~10GB) that causes the process to be killed by macOS.
This issue arises when calling a server action within a client context (in my case, using Tanstack Query's useMutation). After the leak occurs once, it persists even after restarting the dev server, forcing me to reboot my machine.
Let me know if you need more information.
Thanks!
Answered by remib18
In my case, it was actually a very rare case that i had omitted to check for ending up in an endless loop 😅
I do not see any new memory leak as of now. I do find it a little strange that nextjs do not have verifications to prevent / detect memory leak : i would have expected an error indicating that the issue was on my part ^^
I do not see any new memory leak as of now. I do find it a little strange that nextjs do not have verifications to prevent / detect memory leak : i would have expected an error indicating that the issue was on my part ^^
4 Replies
@remib18 Hi,
I’m working on a side project with the latest stable version of Next.js (14.2.14) and encountered a significant memory leak (~10GB) that causes the process to be killed by macOS.
This issue arises when calling a server action within a client context (in my case, using Tanstack Query's useMutation). After the leak occurs once, it persists even after restarting the dev server, forcing me to reboot my machine.
Let me know if you need more information.
Thanks!
you might want to open a bug report in the nextjs repo:
https://github.com/vercel/next.js/issues
https://github.com/vercel/next.js/issues
remib18OP
After further investigations, it seem to be unrelated to nextjs since it happens only on a dynamic route with a certain parameter.
@remib18 After further investigations, it seem to be unrelated to nextjs since it happens only on a dynamic route with a certain parameter.
it looks like it's pretty related to nextjs:
Memory Leak in Next.js 14.2.14
remib18OP
In my case, it was actually a very rare case that i had omitted to check for ending up in an endless loop 😅
I do not see any new memory leak as of now. I do find it a little strange that nextjs do not have verifications to prevent / detect memory leak : i would have expected an error indicating that the issue was on my part ^^
I do not see any new memory leak as of now. I do find it a little strange that nextjs do not have verifications to prevent / detect memory leak : i would have expected an error indicating that the issue was on my part ^^
Answer