InfomediaLtd / angular2-materialize

Angular 2 support for Materialize CSS framework.
https://infomedialtd.github.io/angular2-materialize/
MIT License
409 stars 140 forks source link

Possible memory leak with *ngFor and sub *ngfors. Example provided #110

Open Only1MrAnderson opened 7 years ago

Only1MrAnderson commented 7 years ago

Hello,

I am working through a memory leak on a project and it appears to be related to the Material Selects. My form contains n number of lines and each line has 6 selects, some are multi select. I noticed that the snap shots (heap) I was taking every time I went away from the report and come back it kept getting bigger and bigger. After going through the snap shots it appeared to be related to some HTML elements so I removed the material elements in favor of default browser as specified in the docs and the leak seemed to go away. I went ahead and put together a sample project from the Web Pack starter you had.

Images below show the snapshots.

Github repo; https://github.com/AAAnderson7301/Angular2_Materialize_Webpack

1 2

Only1MrAnderson commented 7 years ago

I just found this in the Materialize CSS docs. Should I be destroying this? $('select').material_select('destroy');