Skip to content
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

Memory leak #222

Closed
GalRab opened this issue Feb 1, 2023 · 4 comments
Closed

Memory leak #222

GalRab opened this issue Feb 1, 2023 · 4 comments
Assignees

Comments

@GalRab
Copy link

GalRab commented Feb 1, 2023

We have a memory leak when there is a lot of concurrency requests, the memory is raised until the container crashed.
It cause by this line:
cachek.once('error', errorHandler); // src/index.ts

I noticed there was a commit (line 209) that changed the behavior when the listener is removed.

Why did it change to remove the listener on error rather than on response?
Does the listener never remove if there is no error?

@GalRab GalRab added the bug label Feb 1, 2023
@jaredwray
Copy link
Owner

@GalRab - looking into this as I believe this was changed do to the way we are handling the response.

@jaredwray jaredwray self-assigned this Feb 1, 2023
@jaredwray
Copy link
Owner

I created a new branch with a fix that would remove both. https://github.com/jaredwray/cacheable-request/tree/fixing-listener-memory-leak---issue-%23222

Can you validate that this resolves the issue?

@GalRab
Copy link
Author

GalRab commented Feb 2, 2023

I created a new branch with a fix that would remove both. https://github.com/jaredwray/cacheable-request/tree/fixing-listener-memory-leak---issue-%23222

Can you validate that this resolves the issue?

yes, it seems to have resolved the issue

jaredwray added a commit that referenced this issue Feb 2, 2023
…issue-#222

fixing listener memory leak - issue #222
@jaredwray
Copy link
Owner

This has been released: https://github.com/jaredwray/cacheable-request/releases/tag/v10.2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants