Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

input: memory leak and excess watchers created #10851

Open
gregyichang opened this issue Aug 14, 2017 · 4 comments
Open

input: memory leak and excess watchers created #10851

gregyichang opened this issue Aug 14, 2017 · 4 comments
Assignees
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P2: required Issues that must be fixed. severity: performance This issue causes a significant performance degradation type: performance This issue is related to performance
Milestone

Comments

@gregyichang
Copy link

gregyichang commented Aug 14, 2017

AngularJS material poor performance and large memory footage:

  • Issue:
    1. When added md-input-container to a page, the number of $watchers increased from 6504 to
      112507?, by total 17 times more than without the angular material tag*`
    2. both md-input-container and $mdDialog cause memory leak
    3. AngularJS Material pages load 4 times slower in Chrome, and almost not able to load in IE
  • What is the expected behavior?
    Expect AngularJS Material app to perform similar as angular only app.

CodePen (or steps to reproduce the issue): *

  • Github: https://github.com/gregyichang/MemoryLeak
  • Details:
    I have two projects "Angular" and "AngularMaterial" to demonstrate that AngularJS Material add a lot memory usage and performs poorly than an AngularJS only app.

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: *

  • AngularJS Version: 1.5.5
  • AngularJS Material Version:1.1.3

Additional Information:

  • Browser Type: chrome, ie
  • Browser Version: chrome 60.0.3112.90, IE 11
  • OS: windows 7
  • Stack Traces:
@gregyichang gregyichang changed the title Angular material poor performance and large memory footage Angular material poor performance, large memory footage and Memory Leak Sep 7, 2017
@locomain
Copy link

is there a fix for this?

@gregyichang
Copy link
Author

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

@Splaktar Splaktar added severity: performance This issue causes a significant performance degradation type: performance This issue is related to performance labels Dec 13, 2017
@Splaktar Splaktar changed the title Angular material poor performance, large memory footage and Memory Leak AngularJS Material performance, large memory footprint, and memory leaks Dec 13, 2017
@Splaktar Splaktar added needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P3: important Important issues that really should be fixed when possible. labels Dec 13, 2017
@Splaktar Splaktar added this to the 1.2.0 milestone Dec 13, 2017
@thedwarf21
Copy link

+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 Splaktar changed the title AngularJS Material performance, large memory footprint, and memory leaks input: memory leak and excess watchers created Oct 4, 2018
@Splaktar Splaktar modified the milestones: Future, 1.1.12 Oct 4, 2018
@Splaktar
Copy link
Contributor

Splaktar commented Oct 4, 2018

$mdDialog leaks are being tracked in #11207. I've updated the title of this issue to focus it on leaks in md-input-container.

@Splaktar Splaktar added P2: required Issues that must be fixed. and removed P3: important Important issues that really should be fixed when possible. labels Oct 4, 2018
@Splaktar Splaktar self-assigned this Oct 4, 2018
@Splaktar Splaktar modified the milestones: 1.1.12, 1.1.13 Jan 3, 2019
@Splaktar Splaktar modified the milestones: 1.1.13, 1.1.14 Feb 10, 2019
@Splaktar Splaktar modified the milestones: 1.1.14, g3: sync Feb 15, 2019
@Splaktar Splaktar modified the milestones: g3: sync, 1.1.23 Apr 30, 2020
@Splaktar Splaktar modified the milestones: 1.1.23, 1.2.0 Jun 8, 2020
@Splaktar Splaktar modified the milestones: 1.2.0, 1.2.1 Jul 29, 2020
@Splaktar Splaktar modified the milestones: 1.2.1, 1.2.2 Sep 14, 2020
@Splaktar Splaktar modified the milestones: 1.2.2, - Backlog Dec 17, 2020
@Splaktar Splaktar removed the g3: sync label Apr 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P2: required Issues that must be fixed. severity: performance This issue causes a significant performance degradation type: performance This issue is related to performance
Projects
None yet
Development

No branches or pull requests

4 participants