-
-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MaxListenersExceededWarning: Possible EventEmitter memory leak detected #1224
Comments
I have the same problem
|
On macOS with this additional configuration I've not yet this issue.
But on linux the memory gradually fills up until the freeze. |
IMO it shouldn't take extra configuration to avoid getting memory leak warnings. Maybe this option should be set by default, out of the box? |
@ffxsam You are absolutely right, it is not the best solution, so I will work on the problem thoroughly |
@EduardMcfly Thanks, Eduard! 👍 It'll save a lot of time for people Googling around trying to figure out how to get rid of that error message. 😉 |
@EduardMcfly It appears this issue may be upstream to serverless-offline. I've had this same issue forever, to the point where it will crash my serverless offline locally, but today, I managed to replicate the issue in Lambda itself. Given that I have my doubts this issue is shared between your codebase and the Lambda Node 14 runtime codebase, it seems like this issue must be from serverless-webpack. I've spent some time investigating before, and I think it has something to do with webpack causing a memory leak (which means those listeners that get mentioned aren't being destroyed as well). I'm not sure how this is happening though so I could definitely be wrong. |
@Alec2435 I was analyzing and this problem is due to serveless-offline, when using serverless-webpack the loss of memory increases much more, but the origin of this problem is from the serverless-offline or from any of the dependencies that are used serverless-offline/src/lambda/handler-runner/in-process-runner/InProcessRunner.js Line 104 in 3fb5b69
So far I am concluding that it may be due to the cache of the dependencies, making profilers this is what is increasing in each call of the handler |
Thanks for your answer, it was really very useful |
Do you have any news? It's still happening, thanks! |
solved the problem for me on Linux. |
this should be fixed with the recent release of v9. please open a new issue if this causes still any problems. |
Bug Report
Current Behavior
When running
sls offline
, I often see this error message:Sample Code
serverless.ts
Expected behavior/code
I wouldn't expect to see this warning.
Environment
serverless
version: 2.38.0serverless-offline
version: 6.9.0node.js
version: 12.20.1OS
: macOS 10.15.7The text was updated successfully, but these errors were encountered: