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 when required repeatedly #102

Closed
davidtheclark opened this issue Dec 4, 2016 · 7 comments · Fixed by #137
Closed

Memory leak when required repeatedly #102

davidtheclark opened this issue Dec 4, 2016 · 7 comments · Fixed by #137

Comments

@davidtheclark
Copy link

(This has been my first effort at debugging a memory leak, so if you have any advice on how I can do this better or be more helpful, please let me know!)

I think I've run into a memory leak in this module. Here's the short backstory: I work on a project, stylelint, that has a lot of tests. We end up running >20K assertions across hundreds of test files. We've been experimenting with the test runner Jest, but it always crashes on Node 4. I logged heap statistics and with each test file saw the heap growing, with inadequate cleanup, until the crash. Through some trial-and-error experiments, I think I tracked this behavior down to a dependency, cosmiconfig, that uses this module. When I change cosmiconfig's usage of graceful-fs to Node's fs, stylelint's memory problem goes away: the garbage collection adequately reduces memory usage when the heap has grown too much.

I'm not sure what the next steps would be for diagnosing this, but I can try to help if anybody has any suggestions.

@mrrinot
Copy link

mrrinot commented Jun 6, 2018

This is still a problem

@alexandr2110pro
Copy link

Yeah! This is still a problem.

@isaacs can you please respond to people?

@sibelius
Copy link

sibelius commented Aug 1, 2018

any changes to add more maintainers to fix this problem?

@kirillgroshkov
Copy link

Still a problem for us as well (using Jest and fs-extra, which depends on node-graceful-fs)

This was referenced Oct 26, 2018
@kirillgroshkov
Copy link

great work! waiting for it to be released and included in Jest, etc.

@SimenB
Copy link
Contributor

SimenB commented Nov 2, 2018

It has been released, and is within semver range in jest. So you should be able to upgrade on your side (although a PR to explicitly bump it in Jest is welcome)

@malthoff
Copy link

Unfortunately this does not fix the issues. Jest tests, although using graceful.js in version 4.1.15, quit working with memory heap errors. The RAM consumption increases with every new test. Anything one can do to drop graceful.js on PC entirely?

B4nan added a commit to mikro-orm/mikro-orm that referenced this issue Oct 22, 2019
graceful-fs and jest does not like each other, so this removes the graceful-fs implementation before running tests and adds it back afterwards.

jestjs/jest#6399
jestjs/jest#6814
isaacs/node-graceful-fs#102
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

Successfully merging a pull request may close this issue.

7 participants