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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ivy Memory Leak: Select & Option Elements #37671
Comments
@Everduin94 can you have a look to see if this is the same problem that has been reported in one of: |
#35164 seems similar. Although, in that issue it's the ComponentView and EmbeddedView that are leaking. In my reproduction, the native element (HTMLSelect) and the component (LeakComponent) housing the native element are leaking. -- That issue is also using Dynamic Components whereas this is simply a select element in a component template. |
Also seeing the same with ivy builds are on. |
Any update on this ? |
This appears to be a Chrome bug, similar to what was found in #40614. In VE the same leak occurs, but in VE's case no internal data structures are attached to the DOM elements so only the detached nodes can be found in the heapdump: |
Edit: I may be misunderstanding, if you're suggesting the source of the leak is the same, but ivy handles attaching internal data structures to DOM elements differently and thus the container components leaks in Ivy but not VE; that makes sense to me. @JoostK I don't think that what happens in VE should be considered the same leak, as the consequences are significantly different. -- In Ivy, the component containing the select element is leaked (as well as anything residing inside of that component). In VE, the component containing the select element is not leaked, and thus everything inside of that component that is eligible for GC is garbage collected. I updated my example to build a large array of data on init in Leak Component: Also, from a debugging standpoint. When I check if my component is leaking, I'll search that components name in the memory profiler. Even if the detached elements are leaking in VE due to a chrome bug, I can still confirm that the component itself is not causing the leak. Whereas in Ivy, I can no longer rely on this process (in dev configuration), as this issue may be what's causing the leak and not the component itself. |
@Everduin94, Do you have this leaking problem in production build ? Seems that i have this problem in production build too with Ivy |
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. |
馃悶 bug report
Affected Package
Minimal reproduction uses Angular 9.1.9
Is this a regression?
This issue does not happen when using View Engine (enableIvy: false)
Description
When running Angular with Ivy (enableIvy: true), if a select element contains an option element, the HTML select element and it's component will leak.
馃敩 Minimal Reproduction
Example using Ivy (Creates leak): https://angular-ivy-select-mem-leak.stackblitz.io/
Example using View Engine (Does not create leak): https://angular-ve-select-mem-leak.stackblitz.io/
馃敟 Exception or Error
None
馃實 Your Environment
Angular Version:
Anything else relevant?
Replicated in Chrome: Version 83.0.4103.106 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: