angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.82k stars 27.5k forks source link

Memory increases #8483

Closed ask4kapil closed 10 years ago

ask4kapil commented 10 years ago

Hi I am using the angularjs app and I have questions regarding the memory management and routing.

I had tested this senario, one app with pure angular js and it has two routes, so when I nevigate between these two routes for 20 times then browser memory increased by 150 MB.

what is reson for this? Is there any setting though which I can controll this?

Narretz commented 10 years ago

This sounds like a bug. Can you please provide a minimal example that we can run locally or in a plnkr that shows the problem? Also, what browsers are you using? Do you see the memory increase in the browser dev tools or in the task manager (equiv). There are also these topics, which describes a similar problem, maybe this is the same: https://github.com/angular/angular.js/issues/8061 https://github.com/angular/angular.js/issues/3543

ask4kapil commented 10 years ago

Seems to the Issue with jquery only... let you know once I will test with jquery 1.9 version

Narretz commented 10 years ago

For angular 1.2, only jquery < 2.x is supported. On master, starting with the next beta we will support only jquery >= 2.0.

ask4kapil commented 10 years ago

Hi Narretz,

The app which I had created seems to be very big, so I can not have the plnkr example but sure I can give you the elements which I had used in this mostly. Elements are

I am seeing the memory increase in the chrome task manager, and with jquery 1.9 its improved with 20 routing now memory increase from 37 mb to 100 mb.

Location of memory heap dump from chrome developer tools https://drive.google.com/a/bits-pilani.ac.in/file/d/0B7-Tcw9R95cYRVo4TTNwREZRQ3M/edit?usp=sharing

zachsnow commented 10 years ago

We upgraded a largish AngularJS application (25k lines of Javascript not including libraries, 20k lines of templates) from 1.3.0-beta.6 to 1.3.0-beta.17 and saw a tremendous increase in memory, with memory apparently not being reclaimed properly (usage grew and grew). Of course, I haven't come close to developing an simple example demonstrating the issue; just wanted to say that there does seem to be something afoot.

Not sure if @kapilkumawatca is running 1.2 or the 1.3.0 beta though.

alexandr2110pro commented 10 years ago

Hi, i've got the memory leak too. I'm using ui-router and after 20+ state changes, memory significantly increases. We don't use jquery.

IgorMinar commented 10 years ago

it would be good to get more info about this. none of our current memory leak detection tests fail, so it's not clear to me what the problem could be.

IgorMinar commented 10 years ago

@tbosch we should investigate this

tbosch commented 10 years ago

@alexandr2110pro @zachsnow @kapilkumawatca We really need a live example that reproduces the problem, including exact browser version. Could you try to create one that shows the problem? Could also be a live site, ...

jeffbcross commented 10 years ago

Moving this to purgatory until we have better reproduction.

IgorMinar commented 10 years ago

we should at least verify that a common scenario (router with a repeater) doesn't leak before moving this to purgatory

On Tue, Sep 9, 2014 at 7:31 PM, Jeff Cross notifications@github.com wrote:

Moving this to purgatory until we have better reproduction.

— Reply to this email directly or view it on GitHub https://github.com/angular/angular.js/issues/8483#issuecomment-55006040.

jeffbcross commented 10 years ago

I'll make a plunker and take a look

jeffbcross commented 10 years ago

I created a plnkr with two views that contain nested repeaters with 1000 rows and 20 columns, as well as one mostly empty view. I recorded the timeline (attached) and clicked through all three views about 20 times (see orange marks at top of timeline created via console.timeStamp()). We could not reproduce the problem so far. If anyone wants to fork this plnkr and make it reproduce the error, that would help us identify any issues.

http://plnkr.co/edit/FUJzRJhYYrSBY9n2QiCn?p=preview

screen shot 2014-09-10 at 12 39 39 pm

jeffbcross commented 10 years ago

Per some discussion with @tbosch we decided to move this to purgatory until more concrete information is provided.

IgorMinar commented 10 years ago

I'm closing this as a dupe of #9095 which seems similar to the original report and is a confirmed leak.