Ask HN: Is there a modern browser that doesn't gobble memory?

10 points by talos ↗ HN
On a Mac. Both Chrome and Firefox invariably over a day of browsing accumulate oodles of memory and must be quit and reopened. Closing every window hilariously leaves this situation:

https://i.imgur.com/jZNoC0I.png

Zero windows, 3.5GB of memory used. Sitting around, it's not as if that memory gets cleaned up.

The frustrating part is trying to be "good" and not have hundreds of tabs open at any point doesn't seem to help -- the memory still piles up, eventually driving the responsiveness of the entire system into the shitter.

13 comments

[ 2.7 ms ] story [ 31.9 ms ] thread
Try out Opera. Vivaldi's not bad either, but has some stability issue still.
On a Mac, as far as I know, Safari uses the smallest amount of memory. (It's the only browser I've used on OS X for a while.)

I'm surprised to see Firefox taking up 3.5GB of RAM. On my Windows 7 PC, it takes about 1GB after a day's browsing (without Flash). I usually have 80-100 tabs but only 15-20 are actually open. It's fine unless Flash goes ape and eats 2GB of RAM for no reason.

I also use Vivaldi and Opera on Windows 7. Both are based on Chromium and both consume more RAM than Firefox. Vivaldi does "lazy loading" so it only loads tabs when you click on them, whereas Opera still tries to load everything.)

It might have to do with the amount of RAM on the computer? On a computer with 4GB of RAM, I've found FF crawls up to around 2GB; on a computer with 8, I've found it crawls up to around 4GB. Similar script blocking and host blocking setups on both, most recent versions of FF (though different versions of MacOS).

Similar horrendous effect on the performance of everything else on the computer til I restart the damn browser.

I have Windows PCs with anything from 2GB to 8GB, and I'm just about to upgrade one to 12GB, so I'll have a look when I get some free time. However, the browser putting a cap on RAM usage would seem a sensible approach....
Is there a way to get the latest version of safari to insert URLs instead of page titles in the location bar when doing autocomplete? That one seems to be the ergonomic dealbreaker for me when I try to use it as my primary browser for a day.
Not really, and here's why:

CNN loads something like 10 megabytes of resources when you open the front page. That's just code and images; all that code has to be parsed, JITed, built into the DOM, etc. and all of that requires exponential-ish (not scientific, but it feels right) more memory than the code itself. All those images have to be unzipped into pixel buffers and painted on screen.

Even assuming your browser could do all of these things right every time, look at how many goddamn standards the browser has to support; many of those features have to be loaded hot and ready to go to improve apparent performance, and those features require a nonzero memory overhead as well. So, in the end, in order for your browser to do anything useful it has to snort memory like a coke addict.

Indeed. Remember we used to use only one tab? Also, the sites have grown enormous and complex, compared the times we had only 512mb of memory.
While this is true, I aggressively block scripts using Noscript & Privacy Badger. I also block plugins by default and have an etc.hosts file that blocks many standard advertising domains.

I suppose this could lead to more leaks, but it definitely reduces the page load time.

That being said, your point about web standards being a mess to support without tons of memory usage (and inevitably leaks) is on point.

Doesn't sound to me like it's an inherent problem to the browsers, but rather that you'd just need to troubleshoot what's causing the RAM usage.

I have no idea about Chrome, but in Firefox you can get a detailed breakdown of what's using RAM by typing "about:memory" into the URL-bar and hitting enter. Then click on the "Measure"-button to the left.

There's also a few buttons on that page to enforce a memory clean-up, so maybe you can try those instead of restarting Firefox next time, if you can't find a solution.

Usually, memory usage like that is caused by some faulty extension, so that's what you should look out for.

You could also try, if it doesn't happen anymore in a fresh profile: https://support.mozilla.org/en-US/kb/profile-manager-create-...

I didn't take a screenshot yesterday when I posted this, but when I've looked in the past most of the memory seems to have piled into "js-non-window".

Actually, checking now -- having left one tab, with only this HN thread left open overnight (and computer closed) FF's memory usage has crawled back up to 2.88GB.

In "Explicit Allocations", 488MB of that are "heap-overhead". 455MB go to js-non-window" , of which 254MB are "zones" and 183MB "runtime". "window-objects" take 279MB, (the js-compartment for about:blank takes 151MB). Another 259MB for "heap-unclassified", and 155MB for "gfx".

In "Other measurements", there are 745MB of "decommitted", of which almost all is "js-non-window". "js-main-runtime" is 666MB, split evenly between "compartemnts" and "runtime" or "zones".

Nothing else is of much significance.

No extensions or plugins seems are explicitly noted in the memory breakdown. In my experience GC, CC, and Minimize Memory Usage make no difference. I do make use of Noscript and Privacy Badger, and I suppose I should try disabling them -- but my gut says disabling plugins that block scripts won't reduce JS memory usage.

Pretty much every time I've checked it really looks like oodles of JS-related memory leakage.

Anyway, not expecting a diagnosis here -- this isn't the appropriate forum for that. Just venting a bit. Thank you for your suggestions!

js-non-window basically means "extensions and the browser UI itself".