You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@ContentChildren memory leak with ngTemplateOutlet #14919
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
@ContentChildren somehow gets hold of children that are passed in a template and instantiated through [ngTemplateOutlet], and never gets rid of them even if they are destroyed.
Expected behavior
I am not sure what the correct behavior for @ContentChildren here is (should it see the children or not?) but either way it should not keep a reference to destroyed children. This creates potentially a large memory leak.
Minimal reproduction of the problem with instructions
I have a similar issue when using NgbTabset from ng-bootstrap and ViewChildren.
The query list just keeps getting bigger and bigger with every tab change.
Just wanted to pile on here since this is currently causing some pretty massive performance issues for me. I've managed to reproduce this with both ng-bootstrap components and the ngx-datatable so I suspect this is a pretty common use case that it leaks on. (As opposed to me doing something wonky/hacked together.)
Activity
alexzuza commentedon Mar 4, 2017
I think here is the same issue #14835
nikidimi commentedon Mar 17, 2017
I have a similar issue when using NgbTabset from ng-bootstrap and ViewChildren.
The query list just keeps getting bigger and bigger with every tab change.
Plunker:
http://plnkr.co/edit/wOCLhhbAlJEraEie2Tl2?p=preview
Switch between P1/P2 and then click "Log children" and it will log the query list to the console.
adammedford commentedon Mar 23, 2017
Just wanted to pile on here since this is currently causing some pretty massive performance issues for me. I've managed to reproduce this with both ng-bootstrap components and the ngx-datatable so I suspect this is a pretty common use case that it leaks on. (As opposed to me doing something wonky/hacked together.)
mhevery commentedon Mar 29, 2017
Dup of #15578 ?
tbosch commentedon Apr 10, 2017
Yes, this is a duplicate.
angular-automatic-lock-bot commentedon Sep 11, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.