Closed
Description
I'm submitting a ...
[x] bug report
Current behavior
I'm using ngTemplateOutlet in a similar way to render a table:
<template #cell1 let-dataItem>
{{dataItem.field1}}
</template>
<table>
<tr *ngFor="let dataItem of data">
<td>
<template [ngTemplateOutlet]="cell1" [ngOutletContext]="{ $implicit: dataItem }">
</template>
</td>
</tr>
</table>
The heap size and node count grows uncontrollably when updating the data.
Expected behavior
The heap size and node count should remain fairly constant since we're only replacing their content.
Note that the application is running in production mode.
Minimal reproduction of the problem with instructions
- Open this plunkr for 2.0.10 or this plunkr for 4.0.0.
- Start your browsers memory profiler or observe the process memory usage
- Notice that memory is not reclaimed
What is the motivation / use case for changing the behavior?
Application memory usage should be stable.
Please tell us about your environment:
Linux
-
Angular version: 2.4.10, 4.0.0
-
Browser: Chrome 57 | Firefox 52
-
Language: TypeScript 2.0