Batu69 Posted July 20, 2017 Share Posted July 20, 2017 Quote I've become resigned to Firefox slowly leaking memory Over the years I've written a number of things here about how my Firefox setup seems to be fairly fragile as far as memory usage goes, in that any number of addons or other changes seem to cause it to leak memory, often rapidly. Sometimes there have been apparently innocuous changes in addons I use, like NoScript, that cause a new version of the addon to make my Firefox sessions explode. (I've actually bisected some of those changes down to relatively innocent changes and found at least one pattern in addon and even core Firefox JavaScript that seems to cause memory leaks, but I'm not sure I believe my results.) For a long time I held out hope that if I only found the right combination of addons and options and so on, I could get my Firefox to have stable memory usage over a period of a week or more (with a fixed set of long-term browser windows open, none of which run JavaScript). But by now I've slowly and reluctantly come around to the idea that that's not going to happen. Instead, even with my best efforts I can expect Firefox's Resident Set Size to slowly grow over a few days from a starting point of around 600 to 700 MBytes, eventually crossing over the 1 GB boundary, and then I'll wind up wanting to restart it once I notice. The good news is that Firefox performance doesn't seem to degrade drastically at this sort of memory usage. I haven't kept close track of how it feels, but it's certainly not the glaringly obvious responsiveness issues that used to happen to me. Instead I wind up restarting Firefox because it's just using too much of my RAM and I want it to use less. (It's possible that Firefox's performance would degrade noticeably if I let it keep growing its memory usage, which of course is one reason not to.) Restarting Firefox is not too much of a pain (I built a tool to help a while back), but it makes me vaguely unhappy despite my resignation. Software should be better than this, but apparently it isn't and I just get to live with it. Restarting Firefox feels like giving in, but not restarting Firefox is clearly just tilting at windmills. Sidebar: The JavaScript pattern that seemed to leak The short version is 'calling console.log() with an exception object'. The general pattern seemed to be: try { [... whatever ...] } catch (e) { console.log(e); } My theory is that this causes the browser-wide Firefox developer console to capture the exception object, which in turn presumably captures a bunch of JavaScript state, variables, and code, and means that none of them can be garbage collected the way they normally would be. Trigger such exceptions very often and there you go. Replacing the console.log(e) with 'console.log("some-message")' seemed to usually make the prominent leaks go away. The loss of information was irrelevant; it's not as if I'm going to debug addons (or core Firefox code written in JavaScript). I never even look at the browser console. It's possible that opening the browser console every so often and explicitly clearing it would make my memory usage drop. I may try that the next time I have a bloated-up Firefox, just to see. It's also possible that there's a magic option that causes Firefox to just throw away everything sent to console.log(), which would be fine by me. Article source Link to comment Share on other sites More sharing options...
IronY-Man Posted July 20, 2017 Share Posted July 20, 2017 2 hours ago, Batu69 said: Instead, even with my best efforts I can expect Firefox's Resident Set Size to slowly grow over a few days from a starting point of around 600 to 700 MBytes, eventually crossing over the 1 GB boundary, and then I'll wind up wanting to restart it once I notice. In my case ; after v48 or 49 , Fox started to reach high CPU usage around 55-60 % and when it reaches that , Ive to restart it in order to surf again cos after that pages wont open anymore , it just keeps on rendering the page but wont show it !! Tried Waterfox and Firefox but issue remains....it mainly occurs of heavy content loaded sites !! Link to comment Share on other sites More sharing options...
WALLONN7 Posted July 20, 2017 Share Posted July 20, 2017 I do not consider myself a lucky guy, nor an exception... But every time I read articles like that I start to think... bullshit...I usually have about 20 or 30 open tabs and I rarely see the ram consumption exceeding one gigabyte and a oscillation between one and four percent of processor... It's worth noting that I'm using the latest x64 stable version and with 23 add-ons installed... So, again... bullshit!!! Link to comment Share on other sites More sharing options...
IronY-Man Posted July 20, 2017 Share Posted July 20, 2017 3 hours ago, WALLONN7 said: I do not consider myself a lucky guy, nor an exception... But every time I read articles like that I start to think... bullshit...I usually have about 20 or 30 open tabs and I rarely see the ram consumption exceeding one gigabyte and a oscillation between one and four percent of processor... It's worth noting that I'm using the latest x64 stable version and with 23 add-ons installed... So, again... bullshit!!! I used to think that too until the issue hit me ....I haven't updated fox after v52 [x64] cos of the addon fiasco thats Mozilla had started and before (v47) and now , I still use about 28-29 addons active and around 30+ disabled with 7-8 tabs (Avg.) and I also never got to or even touched beyond 650MB RAM usage ....but this high CPU usage issue has stuck after v47 and I even have tried alternatively with diff. ver. of both i.e. Waterfox and Fox but issue is still there... !! Link to comment Share on other sites More sharing options...
WALLONN7 Posted July 20, 2017 Share Posted July 20, 2017 4 hours ago, IronY-Man said: ( ... ) I still use about 28-29 addons active and around 30+ disabled ( ... ) ....but this high CPU usage issue has stuck after v47 and I even have tried alternatively with diff. ver. of both i.e. Waterfox and Fox but issue is still there... !! The problem you are experiencing is probably created by one or more of the installed addons. I suggest you: Make a backup of everything now with FEBE; Reset / Uninstall Firefox completely... Do a clean installation; Install an add-on and run a test... Problem?! Nope?! Install the next and repeat test... Do it 'till you find the culprit... Good luck!!! Link to comment Share on other sites More sharing options...
Administrator DKT27 Posted July 21, 2017 Administrator Share Posted July 21, 2017 If you ask me, RAM usage is more of an issue on Firefox mobile rather an a PC which has high amount of RAM. On a former flagship mobile, I cannot even open more than 3 tabs together before one tabs needs to reload. Having said, I too am noticing lag recently. The issue was Lastpass addon, but, disabling it has not fully fixed the issue here. Link to comment Share on other sites More sharing options...
Holmes Posted July 23, 2017 Share Posted July 23, 2017 I tested firefox after updating it to latest and saw my firefox reach two gig in size. I have tried to disable all addons and Im going to do that again I hope its because of addons that would be easier to fix. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.