-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: use single ObjectTemplate for TextDecoder #32426
Conversation
`ObjectTemplate`s are not garbage-collected like regular objects (for some reason). It is sufficient to create a single template anyway, so do that to address the memory leak. Fixes: nodejs#32424
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.
ObjectTemplates are not garbage-collected like regular objects (for some reason).
They are but they're also cached on instantiation. The cache is of bounded size so the memory leak is bounded too but it's still pretty big (on the order of 1 million entries, I think.)
`ObjectTemplate`s are not garbage-collected like regular objects (for some reason). It is sufficient to create a single template anyway, so do that to address the memory leak. Fixes: #32424 PR-URL: #32426 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Landed in b950daf |
`ObjectTemplate`s are not garbage-collected like regular objects (for some reason). It is sufficient to create a single template anyway, so do that to address the memory leak. Fixes: #32424 PR-URL: #32426 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
`ObjectTemplate`s are not garbage-collected like regular objects (for some reason). It is sufficient to create a single template anyway, so do that to address the memory leak. Fixes: nodejs#32424 PR-URL: nodejs#32426 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
`ObjectTemplate`s are not garbage-collected like regular objects (for some reason). It is sufficient to create a single template anyway, so do that to address the memory leak. Fixes: #32424 PR-URL: #32426 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
ObjectTemplate
s are not garbage-collected like regular objects(for some reason). It is sufficient to create a single template
anyway, so do that to address the memory leak.
Fixes: #32424
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes