angular / material

Material design for AngularJS
https://material.angularjs.org/
MIT License
16.55k stars 3.39k forks source link

input: memory leak and excess watchers created #10851

Open gregyichang opened 7 years ago

gregyichang commented 7 years ago

AngularJS material poor performance and large memory footage:

CodePen (or steps to reproduce the issue): *

Perrformance AngularJS Only App: Chrome: 5.8 seconds load 500 student records 1.4 seconds load 50 student records IE: 24.98 seconds load 500 student records 2.15 seconds load 50 student records

 AngularJS Material App:
     Chrome:    20.86 seconds load 500 student records
                         2.93 seconds load 50 student records
 IE:               wait 1 hour not able to load 500 students.
             Wait 10 minutes not able to load 200 students
             42.46 seconds to 50 student records

Memory Footage:

  1. In general, IE use 1.456 times more memory than chrome
  2. Chrome: AngularJS Material use 2.26 times more memory than without it
  3. IE: AngularJS Material use 1.73 times more memory than without it

Memory Leak: Memory leak detected in IE when between two views when AngularJS Material is used in views. --switched views 23 times memory increased by 26 MB in IE $mdDialog cause memory leak in both Chrome and IE -- open and close dialog 31 times, Chrome memory increased by 27 MB, IE memory increased by 12 MB

AngularJS Versions: *

Additional Information:

locomain commented 6 years ago

is there a fix for this?

gregyichang commented 6 years ago

Nope, if your app handles large quantity data, has complex UI and performance is critical, stay away from AngularJS Material

thedwarf21 commented 6 years ago

+1 @gregyichang thanks for your benchmarking. I was just having trouble with $mdDialog and wasn't figuring out why my app could be getting this slow, regarding to the controllers used with my dialog boxes. This post confirms what I was expecting already.

@Splaktar If it can help you fixing this, this page explains how to create giant memory leaks with AngularJS and how to fix them. It really helped me understanding how AngularJS manages its memory.

https://makandracards.com/makandra/31289-how-to-create-giant-memory-leaks-in-angularjs

Splaktar commented 5 years ago

$mdDialog leaks are being tracked in https://github.com/angular/material/issues/11207. I've updated the title of this issue to focus it on leaks in md-input-container.