Skip to content

Compiler.compileModuleAsync related Issue - Memory Leak? #19997

@RajkumarSiva

Description

@RajkumarSiva

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

A Component is not getting destroyed completely (ngOnDestroy is getting called & it is also getting removed from DOM but it stays in memory) after invoking compileModuleAsync method.
Dynamically created components are getting destroyed completely, but the one which created the dynamic component is not getting destroyed.

Expected behavior

Component supposed to be destroyed from router outlet after navigating to another component.

Minimal reproduction of the problem with instructions

I have clearly written the issue in stackoverflow question. I used chrome's developer tool to take snapshot of the memory to analyze memory.

http://embed.plnkr.co/EVFglgkp24hkRkpxrEGe/
https://stackoverflow.com/questions/46984089/angular-dynamic-component-compiler-issue-memory-leak

What is the motivation / use case for changing the behavior?

creating components dynamically

Environment


Angular version: Latest


Browser:
- [x ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerfreq2: mediummemory leakIssue related to a memory leakstate: confirmedstate: has PRtype: bug/fix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions