-
Notifications
You must be signed in to change notification settings - Fork 26.5k
fix(core): do not retain dynamically compiled components and modules #42003
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
Conversation
The JIT compiler has a mapping from component to the owning NgModule and tracks whether a certain NgModule class has been verified; these maps causes any JIT compiled component and NgModule to be retained even if they are no longer referenced from anywhere else. This commit switches the maps to `WeakMap` to allow garbage collecting any components and NgModules that are no longer referenced elsewhere. Fixes angular#19997
Note: there is precedent for using angular/packages/core/src/view/util.ts Line 246 in e12d9de
so this usage here should not require additional polyfills. |
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.
@JoostK thanks for the fix 👍
FYI presubmits went well for the changes in this PR. |
…42003) The JIT compiler has a mapping from component to the owning NgModule and tracks whether a certain NgModule class has been verified; these maps causes any JIT compiled component and NgModule to be retained even if they are no longer referenced from anywhere else. This commit switches the maps to `WeakMap` to allow garbage collecting any components and NgModules that are no longer referenced elsewhere. Fixes #19997 PR Close #42003
…42003) The JIT compiler has a mapping from component to the owning NgModule and tracks whether a certain NgModule class has been verified; these maps causes any JIT compiled component and NgModule to be retained even if they are no longer referenced from anywhere else. This commit switches the maps to `WeakMap` to allow garbage collecting any components and NgModules that are no longer referenced elsewhere. Fixes #19997 PR Close #42003
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The JIT compiler has a mapping from component to the owning NgModule
and tracks whether a certain NgModule class has been verified; these
maps causes any JIT compiled component and NgModule to be retained even
if they are no longer referenced from anywhere else. This commit
switches the maps to
WeakMap
to allow garbage collecting anycomponents and NgModules that are no longer referenced elsewhere.
Fixes #19997