KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm puzzled at why my app's memory increases so much faster in Firefox than other browsers. Basicially, the app uses a decent amount of AJAX, with the basic action being to load new sets of posts that have an average level of HTML, and generally have large images. The total avg data amount per post (incl loaded images) is under 1MB, maybe 900k. Using jQuery 1.7.1. In Chrome memory seems to be stable, but in Firefox, every post load results in about 20MB of new memory use. Since a lot of posts are loaded, you quickly get to over 1GB and even 1.4GB in memory, and things quickly grind to a halt. Digging in on Firefox, I tried to eliminate closures and any extraneous variables using 'delete'. No big improvement. I then started removing functionality, and it seemed like EVERYTHING makes a contribution. Removing ToolTips, some excessive re-loading of FB widgets (one comment widget per post), I made a big improvement, down to 10MB new memory per post. But beyond that, I can't get much lower! Basically, if I just load the new html + images (again about 900k ) via $.post() each post adds ~8mb of new memory, even if the new images have "display:none". (also tried disabling firebug). This is my first attempt at memory management, but this just seems like a lot of overhead, and odd since I don't think memory really increases like that in Chrome at all. Seems like I should get memory increases more in line with the amount of data loaded, not 10X! (or none at all like in Chrome would be nice...) Is this really reasonable? Any ideas on where to look for problems or what I can do to further minimize this problem? Thanks! Update : As Boris aptly observed, the memory increase is almost entirely due to images (at least 80%). But again the memory increase is much more (10x) the size of the images loaded. One other thing I learned using about:memory - if I simply open
Tags (comma-separated)
Save Edits
Cancel