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

Memory leak when using ngView and jquery #8061

Closed
georgiyordanov opened this issue Jul 3, 2014 · 7 comments
Closed

Memory leak when using ngView and jquery #8061

georgiyordanov opened this issue Jul 3, 2014 · 7 comments

Comments

@georgiyordanov
Copy link

The following plunker demonstrates the issue:
http://plnkr.co/edit/BS7EQlBoJDfbMN8bcUop?p=preview

Switching between View1 and View2 a few times makes heap snapshots go up to 40-50 MB.
The problem is related to jquery >= v2.0. Switching to jquery 1.11.1 fixes the problem.
Using a directive with templateUrl and replace=true (which I know is deprecated since 1.2.17) in the view is also needed.

Reproducible: always
Browsers: Chrome 35, Chrome canary (with --js-flags="--nocrankshaft --noopt --nouse-ic") and possibly Firefox 30 (memory goes up easily to 400-500 MB but I don't know a way to force GC in FF)
Operating system: Windows 8

@Narretz Narretz added this to the Backlog milestone Jul 9, 2014
@Narretz
Copy link
Contributor

Narretz commented Jul 9, 2014

jquery >= 2.0 is currently unsupported. Still something to keep in mind, though.

@mgol
Copy link
Member

mgol commented Aug 1, 2014

jQuery >=2.1 is supported in Angular 1.3 until yesterday. ;) (see 9e7cb3c). It's also the only supported version now.

Angular 1.2 remains compatible with jQuery 1.x only, though.

@btford btford removed the gh: issue label Aug 20, 2014
@tbosch tbosch modified the milestones: 1.3.0-rc.3, Backlog Sep 15, 2014
@petebacondarwin
Copy link
Contributor

When using the correct versions of JQuery and AngularJS together I don't see this memory leak. @georgiyordanov can you confirm this is the case for you too?

@mgol
Copy link
Member

mgol commented Sep 17, 2014

Pete, what do you exactly mean by correct versions here?

EDIT: @georgiyordanov is it an issue for you with Angular 1.3.0-rc.2 and jQuery 2.1.1?

@petebacondarwin
Copy link
Contributor

What I mean is the following combinations:

  • Angular 1.2.x with JQuery 1.10.x
  • Angular 1.3.x with JQuery 2.1.x

@jeffbcross jeffbcross modified the milestones: 1.3.0-rc.3, 1.3.0-rc.4 Sep 22, 2014
@georgiyordanov
Copy link
Author

I tested it with jQuery 2.1.1 and Angular 1.3.0-rc3 and everything is OK.
I'm closing the issue.

@petebacondarwin
Copy link
Contributor

Marvellous. Thanks @georgiyordanov

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants