-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
lib: fix memory leak, when module require error occurs #32837
Conversation
@@ -302,17 +302,14 @@ assert.throws( | |||
} | |||
}, | |||
'fixtures/path.js': {}, | |||
'fixtures/throws_error.js': {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test for module loading, verify module.children contains all the different modules that we've required, but should not contain modules that failed to load
Delete useless module in parent module: parent.children array when error occuers so that the memory can be garbage collected. Fixes: nodejs#32836
e3b195b
to
d0b97d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM. I'll kick off the CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for noticing and fixing this issue!
Landed in 6bcf968 I have slightly modified the prefix and detailed explanation in the commit message to make it more obvious. Hope you don't mind. Once again, thanks for noticing and fixing this issue! |
Thank you for your modification, I learned. |
Delete useless module in parent module: parent.children array when error occurs, so that it can be garbage collected. Fixes: nodejs#32836 PR-URL: nodejs#32837 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Delete useless module in parent module: parent.children array when error occuers
so that the memory can be garbage collected.
Fixes: #32836
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes