-
-
Notifications
You must be signed in to change notification settings - Fork 956
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 when using cache feature. #792
Comments
We already are aware of this, but this is not so simple to solve. It's possible to remove the initialization of
|
This is how it's done for got/source/normalize-arguments.ts Lines 96 to 100 in c8b96aa
|
We also need to note in the README that |
Seems like this can be closed now that https://github.com/lukechilds/cacheable-request/issues/30 is closed? |
Yeah... I think so. We could still improve this by pregenerating the instance on |
@sindresorhus Could you release a 9.6.1 that uses cacheable-request 6.1.0? |
A 9.6.1 release would be appreciated |
Hello,
We are facing a memory leak in our production environment, using got and it's cache feature (with a KeyvRedis storage backend).
A heap dump revealed that most memory is retained by multiple error event listener on the single KeyvRedis instance.
Further analysis showed that for each request, a new CacheableRequest is instantiated :
Then, for each CacheableRequest, a new Keyv is instantiated :
KeyvRedis being an EventEmitter, a eventListener is registered.
The full context of the request being retained by this event listener.
Is there something wrong with the way we use got ? Is there a way to prevent CacheableRequest to be instantiated for each request ?
We tried using got.create, but that didn't work.
Thanks.
The text was updated successfully, but these errors were encountered: