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

fix: fix the memory leak introduced in nodejs v10 patch #303

Merged
merged 2 commits into from
Aug 13, 2020
Merged

Conversation

3cp
Copy link
Collaborator

@3cp 3cp commented Jul 27, 2020

closes #302

@nonara
Copy link
Contributor

nonara commented Jul 27, 2020

Looking into this now. First results were inconclusive. It looked like it was working at first, but one of the threads still climbs over 1gb, which doesn't seem right to me.

So, I'm doing some memory profiling now. Going to examine heap snapshots. Will let you know!

@nonara
Copy link
Contributor

nonara commented Jul 27, 2020

Looks good!

I pre-loaded it with one large file (149,382,687 bytes)

This is the heap comparison of before -> after mock.restore().

image

For good measure, I also mocked & restored repeatedly with the same data about 6 times in a row. Reported memory use in task manager stayed the same.

Thanks for the fast work! BTW, Have you had a chance to look at my PR?

@3cp 3cp marked this pull request as ready for review July 27, 2020 22:49
@3cp 3cp mentioned this pull request Aug 10, 2020
@3cp
Copy link
Collaborator Author

3cp commented Aug 12, 2020

@tschaub can we merge this?

@tschaub
Copy link
Owner

tschaub commented Aug 13, 2020

@3cp - yes please. Are you able to? Every time I get the notification, I’m not on a device that is allowed to merge with the failed test.

@3cp
Copy link
Collaborator Author

3cp commented Aug 13, 2020

I cannot. Tried to skip win32 node 12 in CI, but GitHub is not happy about it, maybe I missed some config.

@tschaub tschaub merged commit 47a7979 into master Aug 13, 2020
@tschaub tschaub deleted the fix-leak branch August 13, 2020 14:22
@tschaub
Copy link
Owner

tschaub commented Aug 13, 2020

Thanks for the fix, @3cp. Sorry it took so long to get in.

@harryhorton
Copy link

Can we get a release 🙏 ?

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 this pull request may close these issues.

mock.restore() leaks (no garbage collection)
4 participants