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 from cache option in got #269

Open
spence-s opened this issue Sep 29, 2022 · 1 comment
Open

Memory Leak from cache option in got #269

spence-s opened this issue Sep 29, 2022 · 1 comment

Comments

@spence-s
Copy link

spence-s commented Sep 29, 2022

By default got-fetch adds a simple Map cache to the got options which is currently buggy in got.

Perhaps we could provide a way to turn the cache option off until it is fixed.

Related to sindresorhus/got#1128 sindresorhus/got#1523

import {fetch} from 'got-fetch';

let response = await fetch('https://www.youtube.com');

for (let i = 0; i < 1000; i++) {
  response = await fetch('https://www.youtube.com');
}

// (node:40746) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Keyv]. 
// Use emitter.setMaxListeners() to increase limit
// (Use `node --trace-warnings ...` to show where the warning was created)
@okko
Copy link

okko commented Nov 22, 2022

sindresorhus/got#1523 (comment)

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

No branches or pull requests

2 participants