Hacker News new | past | comments | ask | show | jobs | submit login
Browsers eating RAM (flotato.com)
147 points by todsacerdoti 9 days ago | hide | past | favorite | 168 comments

(Disclaimer: V8 dev)

This post is unfortunately nonsense, because it's making a fundamental measurement error: not including renderer processes for Safari, and only measuring the browser process (which should be expected to be roughly O(1) memory in the number of tabs).

To the author's credit, they _are trying_ to include child processes - I'm not sure why, but `psrecord` seems to not (in local testing) include child processes for Safari even when the "--include-children" flag is passed. I guess it does for Chrome, for whatever reason.

I'm somewhat disappointed that the author, or half the comments on the post, didn't question these _wildly_ different results though...

OK, but the situation still looks shameful. What exactly prohibits a web site from consuming all my RAM? I have never once seen a browser make a misbehaving site wait (frozen with no CPU) for me to confirm that sucking up more RAM is acceptable to me.

What happens instead is that I hit a wall of slowness, forcing me to press the power button and lose all my other work. It's not very gradual, I think due to the nature of the problem, so the browser needs to avoid getting into the situation. It's like UI latency follows a hyperbolic curve, running right up to infinity all of a sudden as the RAM runs out.

What ever happened to computers being at least somewhat usable when all RAM is in use?

I seem to remember that being a pretty common condition back in the 90's. Things would get slow, sure, but not completely and utterly hosed.

When this happened to me recently (unattended Firefox process used up all RAM) the machine was simply never able to recover, even after killing the offending process (thereby making 30GB or so of RAM available) and waiting a half an hour.

For some reason, Linux is specially bad at working under load, both memory (too many applications & browser tabs open) and I/O (copying large files into USB drive).

Ohh this is absolutely infuriating for me (and for others as well [0], for quite a bit of time) on Linux desktop machine, when RAM is fully used OS just freezes and nothing besides reset with a button and potential loss of work can be done about that.


Is it because Linux is optimized more for server purposes rather than desktop ones (For example, when it comes to process scheduling)? I’m curious.

Not really seeing how being unable to recover without Alt-SysRq is any better on the server

It was nice when the OS was 64-bit and multi-threaded, but the browser was not. The browser couldn't grab more than 1 CPU and 4 GiB.

On modern macOS/Chrome it'll be impossible. But on other platforms you can still run 32bit chrome (other browsers)

Haha, yeah. I mean you can still use cgroups or something to accomplish this, right?

Back then, needing to smartly manage RAM (i.e. reserve space for what you REALLY needed; manage your own requests otherwise) was done.

Now, not so much. Dev machines rarely run out of RAM anyway.

> I have never once seen a browser make a misbehaving site wait

Isn't that what Firefox's "a tab may be slowing down your computer" (or equivalent) is doing? However it does not seem to trigger reliably. Good thing for me i disable JavaScript most times!

> I hit a wall of slowness, forcing me to press the power button and lose all my other work

So that's two parallel problems. First is browser is eating too much RAM. Second is OS starts writing to swap instead of triggering OOM killer, rendering the whole system unusable rather quickly. I personally systematically disable swap on laptops/desktops (but keep it on server).

Ideally, client-side scripting in the browser wouldn't be a thing at all (we'd have established, reproducible, secure software distribution mechanisms like guix's introduction channels). In a better world, a browser would for every page disable Javascript/WASM by default, but have a convenient menu (alla Noscript) to choose between different security/performance profiles: webapp for unlimited resources/permissions, simple for basic JS for minor interactions (like LibreJS does), etc..

In our world, the websites we consume decide what resources they're gonna eat, and how much network resources they're gonna load, leading to unexpected CPU/RAM/network usage (inducing €€€€ bills for cell phone data).

> browser make a misbehaving site wait

would be a nice operating system feature

Chrome has a task manager that you can use to kill a stalled tab. The OS has a task manager that you can use to kill a stalled browser. You are never forced to use the power button and lose work.

That would be nice.

Reality: the task manager will not open because there is not enough RAM. Simply moving the mouse pointer can become impossible.

Attempting to close a window goes like this: estimate the mouse movement needed, carefully move the mouse, then come back in 15 minutes to see if the pointer has moved and if it is in the correct location. If it has moved but not as desired, make another attempt. If it hasn't moved, come back in an hour... then try several hours, or maybe the next day. If somehow the mouse is in the correct location, click the button very slowly. Maybe hold it for minutes or hours?

Might be worth turning off virtual memory? I believe that is an option in all the major OSes, and it can help you budget your memory usage as well as avoid a swap lock-up. Is the underlying problem that your machine has just has too little memory for today’s OS & browser versions? Or you’re visiting a specific web site with a memory abusive app? It sounds here like there are important details you haven’t mentioned yet, not that there is a general problem with browsers necessarily. Yes, browsers and today’s OSes and applications all seem bloated from a user perspective and seem to use enormous amounts of memory. I have run out of RAM before and had to wait for VM swap, and agree it’s very painful. But I haven’t had that happen with a browser in years or maybe ever, and nobody I know is having common browser freezes. Is it worth an SSD & RAM upgraded, might that solve the issue?

It's an 8 GiB machine with an SSD. I open lots of tabs, in lots of browser windows, on lots of virtual desktops, but so what if I do? It's still unacceptable to lock up.

If I visit a specific web site with a memory abusive app, the browser is supposed to protect me. It's the same as any security hole. Malicious web sites aren't supposed to crash my computer.

Yes, I'm still blaming the browser. It's the browser's job to provide protection here. It's a security matter. No matter what my browsing habits may be, letting the computer lock up is not at all OK.

We shouldn't be one bad web site away from swap lock-up.

There is no possible computer upgrade that will fix the issue. There will always be a more-terrible web site waiting to consume all resources.

If it’s unacceptable to lock up, then turn off virtual memory. Swap is not a security hole, it’s a feature doing exactly what it was designed for. Swap is the explicit design tradeoff of the system you bought, and it’s the default behavior because most people prefer that their system work slowly to a system that stops working. Fortunately it’s an optional feature, and you can turn it off.

> I open lots of tabs, in lots of browser windows, on lots of virtual desktops, but so what if I do?

Hehe, the expected outcome of this behavior on an 8 GiB machine with default settings is a slow computer. You can blame the browser and spend your time frustrated if you want to, or you can choose to avoid asking the computer to use 20 GiB and then complain when it swaps, by requesting less memory and/or disabling virtual memory. It’s not that fair to go on and on about some vague abstract idea of malicious web sites and blaming the browser for not protecting you, if you are choosing to open lots of windows, browsers, desktops, tabs, and web sites.

> It’s the browser’s job to provide protection here.

If you study the browser design, and if you compare today’s browsers to those of 5 or 10 years ago, you will find that all the browser devs are actually bending over backwards trying to help you. They’re not perfect, but all of today’s browsers are pretty amazing in how well they handle low resources - but - the browser is just an application that does what it’s asked to do. If you use a web app that consumes 1GiB, the browser tries to accommodate your request. How is it supposed to know you want it to cut off the app instead of do what you asked? What if the app asks for more memory in the middle of what you’re doing, do you want it to lose your work??

The OS is the software locking up your computer, not the browser. Everything you’re talking about can and does happen with regular applications. Even if you got your wish of a browser that protected you from yourself, it wouldn’t solve the problem that landing in swap locks up the machine.

> There is no possible computer upgrade that will fix the issue.

I disagree completely. I never have the problem you’re talking about, and I use dozens and dozens of tabs all day long every day with multiple browsers. $100 in RAM right now could double or triple your capacity, if you don’t want to disable virtual memory nor change your browsing habits.

Yeah there is no solution to fixing the theoretical problem that some software somewhere can ask for more resources than you have. That’s not the issue you brought up though. In practice, the issues you’ve raised about browsing are quite easily fixable.

Yep. Safari is good, but it's not magic. I suspect psrecord doesn't catch Safari processes because Safari sends them off to launchd because they get launched via XPC, while Chrome's subprocesses are "true" children.

That is correct. I actually spend half a day trying to find a way to get aggregate memory usage of Safari.

You can get most of Safari processes using plain ps as they share the same command:

ps x -o rss,command | grep Safari

There will be a few system threads (for example used for video rendering) that you will have to tie back to one of the processes using launchctl.

Fun fact: activity monitor actually does it through undocumented private APIs as documented here: https://apple.stackexchange.com/questions/327290/how-process...

Hope it saves someone half a day!

The kernel actually keeps track of this information in an internal "responsibility" field for each process. The private API to retrieve this information (which Activity Monitor uses) is responsibility_get_pid_responsible_for_pid, exported from /usr/lib/system/libquarantine.dylib.

That's pretty much what I suspect from those numbers. Safari seems having constant memory usage no matter how many tabs you open. Unless its unloading inactive tabs from ram, there is no way Safari can save ram by using almost 0MB for new tabs.

Can confirm this as a Safari user: old tabs are reloaded sometimes. I guess it's related to memory pressure on the system, seems to be a lot more common on iOS (which of course runs on more RAM-constrained devices).

This is really interesting feedback, but you didn't respond to the Flotato numbers (since this is an ad for their software). Is the dev tricking themselves into thinking they're doing well because they're measuring their own app usage incorrectly?

From what I can tell - yes. Their app uses the standard Safari render processes, so they're only seeing the cost of the main process.

I was looking at those graphs and thinking exactly that, but that’s a byproduct of google marketing making it sound like chrome is the only browser that does that :D

istat menus seems to better report aggregate memory usage. I’m getting 750 mb for Safari on a clean launch with just those two tabs. (It drifts up to 850 mb and back down if I interact with them.)

> I'm somewhat disappointed that the author, or half the comments on the post, didn't question these _wildly_ different results though...

Given that Chrome is busy trying to subsume the web and the OS (it has bluetooth now, and usb, and serial ports, and over a thousand chrome-specific web apis [1]), no one is even remotely surprised to see such results, because by now people just assume Chrome to be a beast. And Chrome has in the past been the most RAM-eating of all browsers out there.

The graphs should be questioned, of course, but Chrome has already earned its reputation, and it's very hard to un-earn it.

[1] https://web-confluence.appspot.com/#!/confluence see "Browser-Specific" tab

This is a bizarre rationalization of a misleading post. So what if Chrome has features, some of which you don't care for? That doesn't make the post right.

he's not rationalizing the original post, he's rationalizing the thread parent's

> half the comments on the post, didn't question these _wildly_ different results though...

The whole browser situation at the moment is so incredibly frustrating. I will NOT browse the internet without a fully-fledged adblocker - no pihole is not enough.

This means pretty much only using Firefox - but I have about 10 tabs open at the moment, each using over 500mb of ram while idle. What on earth they are doing I don't know... and I find it very sluggish when playing video.

Chrome is my daily browser, even after they limited the number of rules that ublock origin can use. But it grinds to a halt on my top of the range macbook pro and uses 100% cpu if I open a couple of twitch streams and 20-30 other tabs.

Safari is a joy to use, much better on battery but webextension implementation means ublock origin is not possible.

The crazy thing to me is the ads aren't even the biggest problem anymore: it's clunky SPAs that load 1MB of js to save 10kb of HTML on navigation.

I know when I've clicked on a medium.com link because my CPU fan spins up chewing on all the framework junk.

In Firefox reddit (new version) will sit at about 50% of a core on my laptop. Simple mouse hover effects on the page lag about half a second behind my actual mouse cursor. YouTube (while not playing a video) will use about 15% of my cpu, even when idle in a background tab.

I’m not sure if the bug is in Firefox or in the sites, but it’s awful. I don’t understand how these issues don’t get fixed immediately. I thought for sure after the new reddit redesign landed that they’d iron out the performance issues in a month or two but I swear if anything it’s gotten worse.

It probably works fine on the developers' 32-core 96GB workstation, so could not reproduce, problem is on your end.

New Reddit is almost unusable for me in Safari as well, it amazes me how they are so popular when the experience in the browser is so bad. (old.reddit.com kinda works, but lots of embedded things like slideshows or videos are a really bad experience)

I have the exact same issues you’re describing - but only on my third monitor that’s attached to its own GPU. - I’m still investigating, but I think it’s a PCIe issue.

Also, do you have an NVMe or Optane SSD attached?

> In Firefox reddit (new version)

Lately been using teddit.net for browsing reddit and it’s been great.

Did you report it? You can use firefox profiler to learn what triggers CPU usage.

No, ads are a big problem too, let's not pretend they aren't a horrible blight. With that said, it is a bit ridiculous that webpages load MBs of JS (SPA-related or not), and that browsers load hundreds of MBs to JIT said Javascript...

Im confused, your post says Firefox is the only possible option but chrome the daily driver?

I use Firefox on windows and Ubuntu and yds it eats ram but I don't really experience any sluggishness or issues from this.

Wipr is what you’re after. “Native” adblocker for Safari. I’ve switched to it from uBlock years ago and not looked back since.

Wipr is fantastic! It basically convinced me that manifest v3 wasn’t going to be the end of the world after using it in Safari.

Still not as good as uBlock origin in terms of blocking quality.

I much prefer 95% ads blocked and 2% CPU with Wipr vs 99% ads blocked and laggy browser on uBO

I went to check my Firefox memory usage on Windows 10 (two tabs, extensions include ublock, facebook, bitwarden, contrast and multi-account containers) but I saw something unexpected.


Adding up the RAM totals 671.7MB on a 16GB device. But why do I have one Firefox with 4 sub-processes, and 3 (no 4) additional lone Firefox processes? I think the 4 background processes must be extensions in sure, but then what is the primary process with 4 sub-processes when I only have two tabs?

Without extensions, it looks like the browser is using about 280MB.

“4 sub-processes when I only have two tabs?”

I don’t know anything about Firefox’s specifics, but forking an already initialized process typically is faster than launching a new process, so if I were to write a multi-process browser, I might have an empty, initialized, process hanging around of every type that can be forked and then sent a message to load a page or extension.

Alternatively, Firefox could keep processes running on the decent chance that you will want to open a new tab soon.

If you go to about:memory and click on "Measure" you can get some information about what is in memory. In addition to web pages, Firefox uses child processes for things like the new tab page, extensions, talking to the GPU, and some other things. It also uses a preallocated process like another commenter suggested, to speed up opening a new page.

I don't think you can compare Windows Vs Mac when it comes to FF. There have been countless complaints about FF mac performance over the years - even after they supposedly fixed it all.

15 FF tabs open currently: https://ibb.co/MRkJjwY

- 1 outlook email tab - 1-2 custom web apps for dev work - the rest are jira and gitlab

Check `about:processes`. (I'm not sure if this is only available in Nightly right now.) It lists all processes, threads, and their memory + CPU usage.

This is cool. I did not know this was a thing.

If you take a profile (perfht.ml) it'll show you the names of the processes as part of the profiling report.

I'm in the same boat.

No matter how much I like Safari optimization, taking advantage of OS, eye candy, etc. - this is all SECONDARY to a full functional ublock origin.

This is non-negotiable.

I prefer ubo, but have found adguard very tolerable for browsing with Safari

Adguard is an electron app that runs in the background of your machine. I found the whole idea of that apalling and uninstalled it.

You don’t have to keep the app open, it’s just for setting settings.

+1 for AdGuard. I picked up a lifetime license a while ago but I was sceptical. Now I have it installed on my iOS devices and on my Mac. Working fine.

It's all worth it because Javascript is such a fantastic evolution in programming language technology, productivity, security, scalability, and consistency.

Sigh. That's sarcasm if it wasn't apparent. And no I don't care if Typescript / ECMASCript v-latest "fixes everything".

The V8 devs are certainly doing yeoman's work, but at the same time that hard work enables all the JS insanity to get worse and worse, to say nothing of the advertising sociopaths, tracking cookies, and browser profiling.

I 100% agree that it should be a required feature of web browsers to limit RAM, disk, and CPU usage. Yes you can prompt for more resources, no you can't ask for unlimited.

Cue every website asking for that along with cookies, and not working otherwise. And of course, notifications.

I'd appeal to google to start enforcing good behavior, and maybe Apple, but that would be counterproductive

Chrome is a pig for sure, but most attempts I see at measuring memory consumption are wrong. The two main ways they're typically wrong is either by misunderstanding how memory works (which is to be expected, it's subtle![1]) or by doing the measurement wrong (e.g. confusing CPU usage for RAM, or looking at the wrong process, or using a memory consuming extension in one setting but not the other). I think this post does both.

(Disclaimer: I worked on Chrome. I believe the conclusion "uses a lot of RAM" is correct, but it doesn't mean the reasoning that led to there is right.)

[1] http://neugierig.org/software/blog/2011/05/memory.html

Those numbers don't make sense to me, it claims that Safari would use 73M of memory with both Twitter and Gmail. But locally on my machine I see that Activity Monitor already reports 490M of memory usage just for the Gmail process of Safari alone. The Twitter login page also already needs 90M. Can someone check as well?

Yep, was thinking of the same thing when I read it. I have 2 gmail tabs in Safari, each taking over 1GB. One twitter that's about 1GB, one Slack that's over 1GB. Some of this is shared memory.

Is it that they don't realize Safari is a multi-process architecture, and they're only measuring Safari's main process?

I’ve tested Safari many times before comparing it to other browsers (and correctly including child processes) and it has always beaten every other browser by using varying degrees of resources less than its competitors. Sometimes a surprisingly large number, sometimes not too much.

But there’s something people need to take into account as well: there’s only so much browser developers can do to optimize the browser. Website developers need to do their part as well. And Google is by far the worst offender in this regard. Facebook isn’t much better.

Most Google-owned webpages you visit are going to use at least 500MB on Safari or 800MB on Chrome. This is nonsense! If they were to develop a native app with exactly the same features it would take at most 250MB of RAM for the largest pages (such as large spreadsheets) and it would be a lot faster.

Compare Google and Facebook webpages to almost any other webpage and you will see they use too much RAM. People are unfortunately getting used to thinking “oh, I have 8 tabs open, that’s too many” when in fact it shouldn’t be.

I know I’m a tab hoarder, I don’t deny that. But using Safari currently have over 13 windows open, each with at least 25 tabs, not to mention plenty of native software running and still have a very fast and functional Mac. It’s not like I have 2TB of RAM either: 16GB of RAM is more than enough to do that. About a year ago (before I upgraded) I did pretty much the same thing with a 8GB RAM 2013 Mac and still didn’t have issues.

The only tabs Safari ever tells me it has reloaded because it’s using too many resources are Google-owned websites. This doesn’t happen with any other website at all from the hundreds of tabs I have open.

Any multi-process browser is going to be an extreme RAM hog. Any JS-engine priority browser is going to be a CPU hog. Modern web browsers are not browsers, they are bloated virtual machines with a bit of browser tacked on.

If you want a browser for the web instead of a JS virtual machine you have to look backwards, not forwards.

Safari has a very decent JS engine, so I don’t think that’s the problem.

I use Safari because it's best by a mile on macOS for power consumption, but if you ever use a memory hungry site like Facebook for more than a few minutes it throws up a memory usage warning and everything becomes extremely slow and you get astronomical scroll jank. I'm guessing that's because it throws a hard cap on tab memory usage and if you go over that it thrashes wildly. So it respects your system, but in doing so is harder on the user for some of the most commonly used websites and might be whacking your drive.

You got about 10 minutes to look at Reddit with the new design

Safari + Old Reddit redirection is the way to go here.

Now if only there was a way to calm Twitter down...

Check out https://nitter.net/

I redirect all twitter links to nitter. For me nitter loads much faster.

If you're logged into reddit, there's an option to just use the old layout which doesn't need an extension to redirect you.

It doesn't work for all Reddit links, sadly - and it doesn't work if you're in a private tab.

I built an extension to do it: https://secretkeys.io/oldr/

That setting seems to disable itself every 4-8 weeks.

Reminds me I wanted to build a textonly proxy (like https://lite.cnn.com/en and similar) for all the web...

This is the reason i was used in past two Facebook sites - mbasic. and m.

But Facebook surprises me with removing Messaging functionality from mobile sites. So i must use desktop site. Within 5 minutes fans starts howling...

Tip: Messenger.com is a stand alone facebook messenger webapp.

No need to load all of facebook.com

I have a MBP 16" and from testing/experimenting...I get about ~5% less battery life when using Brave, than when using Safari.

So the power consumption thing is quite the myth as well.

Yep this is really weird and annoying. I get it even streaming video in full screen.

Don't have a Mac so can't look into it but can anyone confirm this test is actually right? E.g. Brave claims (I don't use Brave I just know they had this claim) Safari is worse for memory usage https://brave.com/brave-one-dot-zero-performance-methodology... while this product that uses Safari claims it's 10x better.

Obviously both claims can't be true. From what I remember with Edge (pre Chromium) and Firefox I'm going to guess Safari doesn't really use 1/10th the memory of everyone else - maybe I'm just not familiar though!

Anecdata: I find browser RAM usage varies enormously depending on which specific websites you use.

The Flotato test uses Twitter and Gmail (for the first set; it doesn't specify the sites used for the 2nd set). Both Twitter and Gmail are large, complex, slow webapps which likely do some sort of advanced active memory management (extensive use of service workers, local storage, etc.). They also load mainly (exclusively?) 1st party resources.

The Brave tests use a large varied set of sites[0], which seem to be a combination of simple news & ecommerce sites. There are no complex webapps in the list. Modern news sites do have a reputation for being slow and heavy, but this will mostly be due to 3rd-party resources from ad companies; the sites themselves are simple and lightweight in terms of 1st-party content.

So they seem to be comparing very different browser usage patterns.

Given that, and looking again at the Brave tests: Safari does actually have lower memory usage than Chrome for most of their graphs. It just creeps slightly ahead of Chrome in the later tests.

[0] https://github.com/brave-experiments/browser-comparison-tool...

As a side note, GMail memory usage has improved vastly (probably because it was monstruous to begin with). Years ago my GMail tab consumed almost 500 Mb, but nowadays it uses less than 100, with my same usage patterns.

Gmail specifically has massively improved recently for me, but I feel it tends to be more of a spikey graph than a steady trendline over time. Memory usage went through the roof when they first rolled out their current redesign, despite already being far too high before. I assume Gmail will get worse again at some stage.

Similarly, Google Docs & Sheets are abysmal currently; not really sure if they were ever significantly better or worse in the past.

In terms of webapps, Google's approach has always seemed to be to make things that are powerful, sometimes usable, but with no focus on performance, cross-browser compat, or general industry best practice at all from a frontend engineering perspective. Any engineering quality in Google products has never in my experience lived in client-side code. This is exacerbated by the fact that "code quality" drives in other companies are often sneaked onto managerial priority lists under the guise of SEO requirements, something Google have never needed to meet.

Four years ago, I found Gmail to tend to use 80–200MB in Firefox, mostly in the lower half of that range. Certainly I found the figures in this test utterly unbelievable for this reason; Safari ain’t lighter on memory than Firefox, let alone that much.

But also for reference, it’s not like something of Gmail’s complexity has to use that much memory. Fastmail provides equivalent functionality minus chat in a 10–15MB budget, and you can add calendars and contacts (which are separate in Google land) and still keep it to 16–25MB.

300MB onload, dropped to 240MB after idling for few minutes. Are you sure it's using less than 100MB? in comparison with the post, it takes about 500MB ram, which is weird for such simple webpage. This HN page takes 40MB.

Oh sorry, I measured it on Firefox. Chrome on Linux started at 160 Mb, and it settled around 150. I've disabled Hangouts, and the right sidebar, so that might account for the differences.

Funny how Firefox reports a third of that, although IDK if Chrome and Firefox task managers are directly comparable.

Chrome does use a lot of memory, but I’m extremely skeptical of this blog post’s methodology and results. Does it seem realistic to have 54 different real web pages open that total under 1GB? (If they’re opening tiny fake pages, this test is misleading and useless.) Most real web sites transfer several megabytes on load. CNN.com loaded 4.2MB for me. Amazon.com loaded 4.3 MB. That’s just the data transfer of compressed assets. The images and content have to be uncompressed and rendered, which takes a lot more memory.

I’m playing on a Mac right now and see nothing like what is reported here. When I open cnn.com in Safari, that tab alone takes 1GB. Chrome reports far less usage than that.

Also “Real Memory” is not the same as active memory in RAM, it’s not necessarily giving a complete picture. Memory can allocated but unused or compressed or paged out.

I don't have stats handy, but this has been published lots of times by many different authors. As others have said, comparing browsers fairly is difficult.

But Chrome is simply not an efficient browser on Macs. Anecdotally, it uses more memory and measurably consumes more energy. The Mac's fan will run more when using Chrome, and you will need to charge more often. If you use a lot of tabs, your entire computer will slow down.

There's market validation for this assertion. There is a YC-backed company currently working on tech to offload Chrome tabs to the cloud so the browser uses fewer resources. This is not something that would be identifiable as a problem in Safari.

If you have access to a Mac, you don't need to take anyone's word for it. Just use Chrome for a few days and then use Safari for a few days. The difference is pronounced. If you use your browser heavily, you will notice.

Since password managers are in the news, Safari also syncs passwords to iOS devices (password sync also works in native apps). It's free.

I use a MacBook Pro 2016 everyday. Safari is easily the best browser memory and systems wise, but I still mainly use chrome because it’s better at addblocking and synchronises with my non-Mac devices.

Chrome is fine though, as long as you don’t open 20+ tabs. Beyond that it’s not fine.

I replaced Firefox with Chrome because it kept ranging from a great to terrible user experience with various updates.

This is all anecdotal and based on personal experience.

On iOS I mostly use Safari even though that is kind of against my synchronised argument, but it works alright as I have found that I use my phone for very different web things.

> …I still mainly use chrome because it’s better at addblocking and synchronises with my non-Mac devices.

(In case you're interested…)

iCloud for Windows now does bookmarks and passwords sync. https://support.apple.com/guide/icloud/icloud-for-windows-ov...

For ad blocking, I really like 1Blocker. NextDNS is great as well.

I am, thank you.

I’d suppose some of it relates to sites with heavy ads. Safari with no extensions will likely require more resources which makes the comparison a little skewed vs Safari with some ad blocker support added via extensions.

It looks like their test includes plenty of ad heavy sites like news articles which seems to confirm that the results are cherry picked.

The linked blog post doesn’t state it explicitly, but I suspect that the non-Brave browsers were not equipped with any kind of adblocking for the test. Brave has built in adblocking, so if my suspicions are true the test is rather disingenuous. At minimum Firefox and Chrome should have uBlock Origin installed and Safari should have Wipr or 1blocker installed to make it fair.

We already know apple's own software has special exemptions in the OS e.g. from packet sniffers.

Any reason to trust the ram usage for Safari nowadays?

I used to have this problem, I routinely keep well over 100 tabs open. Then I disabled default loading of javascript and now I never hear my fans.

In spite of how it seems the "web keeps getting bloatier", something did in fact improve during the last year or two. A whole lot more websites now at least load with javascript turned off. That definitely wasn't the case around ~2016 or so.

I tried disabling javascript a few years ago and the entire web broke. Tried it again last year and have had much more success.

Servers side rendering for SEO purposes I guess.

RIP #!

This is my strategy as well. I use browsers which allow selective enabling of JS and avoid sites which require JS to display content.

In the process, I've found a strong correlation between quality of content and quality of interface accessibility. When a site makes me jump through hoops to view the content, be it enabling JS, video DRM, paywalls, or modal overlays, the content is typically of low quality as well, and I feel like I actually gain more from avoiding it than from going through the trouble of accessing it.

Sure that's counting all processes? My Safari process stays the same size no matter how many tabs, but I'll get a bunch of web content processes. Although that would apply to Chrome, too, of course.

A lot of people here are criticizing the methodology. That's fair, I don't know enough to weigh in.

But what I can say for sure is that in real-world use, on Mac, Safari absolutely feels lighter weight than other browsers. The fans spin up less, the battery lasts 30% longer, and other apps seem to be more responsive. I don't know if that's memory or cpu or what have you, but it's real.

You do pay a price in actual page-load times. Chrome absolutely has a small but noticeable edge in raw browsing speed.

I suspect this comes largely from Safari's tight integration with the rest of macOS. I recently had occasion to read a bit of Chromium's Cocoa UI code (to help the developer of https://github.com/blueboxd/chromium-legacy track down some bugs), and my very surface-level interpretation of what I saw could be summed up as "how can we get rid of macOS's native functionality and use our cross-platform stuff instead?"

I have plenty of anecdata to share on this confirming Safari is generally lighter, and for common usage that should be pretty reliable.

But from the same anecdata experience, what happens when it’s not is awful.

So the significant difference between Safari’s and Chrome’s model is how tabs are pooled into subprocesses. Safari quickly groups same-origin tabs into the same process which has a huge memory cost advantage. Chrome very aggressively spawns subprocesses per tab up to some pressure metric before it starts sharing processes across tabs, which consumes more memory but much more readily frees it too.

Safari’s model is basically more shrewd and probably better for average users, but the pathological case is GBs of unused memory with unclear priority and total system stalls. Chrome’s pathological case is much easier to reach but much easier to recover from because for the most part closing or killing a bad tab process fully relieves its resource pressure.

Long ago man landed on the moon using 4 kb of ram. Today it takes 1 gb of RAM to open a chrome tab.

Going to the moon was a government project. We need the extra 1023 MB of RAM to store all the advertisements and user tracking scripts required for a company to do anything under capitalism.

and that 1gb of ram costs less than $5. That 4kb of ram costs, i bet, way more than the inflation adjusted $5 back then.

And chrome's UI is much more fancy, displays way more data, and has way more functionality, than the UI that was powered by the 4kb of ram.

It's a cute comparison, but ultimately, it's meaningless.

I bet that interface loaded faster than a modern website tho..

Edge Insider Channel versions offer sleeping tabs functionality. I set mine to go to sleep after 5 minutes, works great.

>Using sleeping tabs on Microsoft Edge typically reduces memory usage by 32% on average. It also increases your battery life as a sleeping tab uses 37% less CPU on average than a non-sleeping tab. Although individual device performance varies depending on configuration and usage, we’ve heard from users that this decrease in resource and battery usage has improved their browsing experience.


For Firefox there is the 'Auto Tab Discard' addon. It has the ability to discard (unload) tabs after a certain amount of time or the number of non-active tabs is greater than a number, these are set in the addons options. Also has the ability to whitelist tabs, web sites, so that they never get unloaded.


I'm by no means a Google shill, but RAM is meant to be used. What's the point of my RAM if it's just going to sit there...doing nothing, gathering dust, all the time?

I read some comments complaining about slowdowns and I just have to chuckle. You do realise computing technology grows exponentially with time, right? Your hardware is outdated by the time you get your hands on it, and only gets worse performance-wise as time progresses. This has been true in literally every era of personal computers.

You can't seriously expect a CPU from nearly a decade ago and, what I assume, barely 6GB of RAM to sustain your 10+ tabs, YouTube videos in HD/4K/etc, and your heavy workloads outside of the browser at the same time without some slowdown.

I'd agree that modern browsers (and applications in general) have become more resource hungry, but do you think these new and fancy features come without a cost?

If you're so concerned with memory usage, why not use wget instead of a browser?


From homepage,

>From browser tab to magic Mac app. >Break free from the browser and add web pages to your Mac dock. How about a mac app for Gmail, Twitter, Instagram, Netflix, and literally millions more?

From their help page,

> Dig in to making real Mac apps from websites with Flotato.

Looks like you can create apps of your websites. And it looks like it does it using Safari's engine.

It’s a pretty nifty app: you download it and you have “Flotato.app”. If you want a “Gmail” app, you copy Flotato.app, rename that copy to “Gmail.app” and open it. It will open Gmail, and the app icon changes to the Gmail logo.

So far this has worked consistently for more or less every site I tried.

Isn't that just the same as installing a PWA? (https://developer.mozilla.org/en-US/docs/Web/Progressive_web...)

Exactly but with the benefit of using the Safari engine and some other bells and whistles

Safari can install PWAs using the Safari engine while also taking advantage of the same Content Filtering API measures you use to get rid of crap.

I am not sure what this product really achieves.

For anyone curious, the GNOME Epiphany browser on Linux has this feature as well. Incidentally, it's also based on Webkit2-Gtk internally (Webkit is the Safari browser engine).

Wanted to learn about flotato after reading the post but the hamburger menu doesn't work on Firefox mobile...

It doesn't work in Firefox desktop either. I guess they only test with webkit based browsers.

The hamburger menu doesn’t work on iOS Safari either!

Oh don't worry it also doesn't work on Safari mobile. It's just broken, not an incompatibility oversight.

Could it be similar to the "Linux ate my RAM" situation and that the RAM is used but still available?

As the author of a task manager, I can confirm that RAM usage is... complicated.

What do you mean? If it's allocated to chrome it cannot be reused by other software. Even if it's allocated but unused

You absolutely can allocate memory without using up any backing resources. On Linux (which is where I have experience, but I assume macos works similarly), even after mapping some memory, it won't be backed by any physical memory (e.g. RAM) until you actually write there. And you can mmap files into your address space, meaning you can place a huge file you can access through memory, but it's not actually taking any RAM, the kernel is just doing the reading of each "chunk" of the file as you access them, unloading the old bits once you stop using them for a while.

Measuring memory usage is hard.

And that doesn't even get into decommitting and related things, where you mark memory that you have used as no longer needed but still "there" in a variety of different senses. Not to mention the extra fun on OSX where you can mark something as unused, but OSX makes you pinkie-promise to let it know before you start using it again. If you don't, it works, but the accounting becomes inaccurate. "Fun".

So can you allocate more memory than what is available in this way?

Yup! Processes see/use virtual memory, not the literal physical RAM address spaces. The kernel maintains mappings between virtual-physical and will allocate/free physical memory as needed. All of this is invisible to the process.

Pretty neat huh?

In fact, this is the entire premise of virtual memory! More memory is/can be allocated than physical memory exists. Each process has its own isolated address space with (from the process perspective) "unlimited" size.

I'm surprised that no one has mentioned Microsoft Edge here. No dog in the fight (I don't work for Microsoft), but I've found Edge uses significantly less RAM and CPU - my fan rarely goes on now except for Google Hangouts. There was a point after upgrading to Big Sur that the fan was spinning a lot with Edge (or for other reasons), but that seems to have been solved.

The other thing to mention is that the functionality provided by Flotato can be mostly duplicated in Edge by just creating Edge apps for common webpages. I've done this with GMail, Youtube TV, Youtube Music, etc. There are sometime limitations (you can't have Outlook as an app and Outlook Calendar as an app), but it's pretty solid. These apps seems to bring down RAM and CPU usage, but I haven't measured formally.

Bonus: I have setup two different profiles in Edge - one for work and one for personal. What's nice is that if you create an app like Gmail under your personal profile, links from that app will always open in the associated profile - in this case my personal profile. This is, for me, absolutely groundbreaking but that's for me. In the past I've tried to use standalone email programs and it would constantly drive me crazy when I had, say, a personal and work inboxes, and then I click on a link in my personal email and it opens in a work browser window because that was the last one I clicked.

I've been testing Flotato and it seems really buggy - couldn't get many apps to even run.

Most commercial Websites today are shamefully-engineered pieces of complete and utter garbage, even with Ad blockers on. I have resorted to using no-script and whitelisting specific sites manually. In the old days, games and cool graphics would drive hardware upgrades. Today it's the web.

This test is broken. I tested with Mac and Windows. Safari and Chrome numbers are very close. Author didn't collect correct data.

its sad not to see firefox :(

Had the misfortune of having to do a FB messenger video call with Chrome yesterday. Chrome and Facebook with one window open brought my 2020 Intel MacBook to its knees.

Activity Monitor showed windowserver at about 50% CPU usage, Chrome at another 40%.

I thought Teams was enough of a hog, but clearly FB is worse.


I did not have time yet to schow whether the claims are true but i found this when searching why i have insanely high windowserver cpu activity.

Seems chrome on mac is heading into a strange direction. For normal browsing i use safari since a long time as the battery will last the longest compared to firefox and chrome. But the chrome developer tools are so damn good i can‘t get rid of it for development.

I stumbled on this site last week and anecdotally I can confirm that disabling Keystone helps. I was driven to find answers after no longer being able to hear people on Zoom calls because of the fan noise from my 16" MBP. I got sick of having to wear noise cancelling headphones when Chrome and Zoom turn my laptop into a space heater.

The Keystone thing though, it's not a panacea. It seems to fix the issue with WindowServer running away with the CPU, but Chrome is still pretty terrible. I decided to just deal with the switching cost and stopped using Chrome altogether. It has made all the difference. Switched to Firefox and I'm not looking back.

How do you disable Keystone?

I find Firefox dev tools sufficient pretty much 100% of the time... have you considered it?

I use Firefox as my main browser (and always have -- just to give some context about where I'm coming from). But Firefox's developer tools are just not as good as Chrome's. Again, I use Firefox. But every couple months or so, I stumble upon some annoying instance where its developer tools are either inadequate or are just buggy (whether it's the element inspector not working, or pausing on a debugger statement and not giving me a source view, or applied CSS rules not showing up, or some weird behavior in the console, or...), and I have to resort to using Chrome's developer tools to get the issue resolved. This easily accounts for 90+% of my Chrome usage (i.e. more than the number of times I've had to resort to opening a website in Chrome because the developers didn't test it in Firefox).

Have you used the firefox performance timeline, it is awful. Chrome's performance timeline is amazingly smooth and has much more features.

WindowServer is more than just chrome. I don't doubt chrome is eating the resources on my machine, but it's not as simple as this site makes out.

> I reached a point where I could barely hear the podcast I was trying to listen to. That's how loud the fan was.

> focuses mainly on memory usage

I mean I get it, Chrome is not the most efficient browser out there and Safari is more efficient in terms of memory and power usage. I'd probably use Safari as my daily browser if I didn't depend on Chrome's dev tools.

What's the tradeoff though? Usually you sacrifice memory to spare the CPU, and vice versa.

Security and stability is an other tradeoff: isolating code by running it in separate processes has a cost both in terms of memory and CPU.

Safari has separate processes.

Chrome takes this to an extreme. It has a process per site instance rather than a process per site. You can toggle this by feeding it —-process-per-site as a command line argument.

Safari provides slightly less security in exchange for less resource usage, since some websites allow multiple user accounts to be logged in at the same time and Chrome will protect users data better in those scenarios.


This type of browser looks good to use along with tiled window managers like i3 and xmonad.

Off topic: a bit hard to read on iOS Safari because left margin is 0 (or close to).

Back to the subject at hand: Chrome is a memory hog and there’s nothing new here, but nice to see the comparison with Safari. Too bad Firefox wasn’t part of the test.

Time to buy some fanless RAM

Article is missing the relevant browsers; Firefox, Brave and Opera.

Opera GX allows you to limit the amount of CPU and RAM the browser can use. Much of this is of course marketing, properly implementing this can be hard, but it would have been interesting to compare how well this works.


"Need every ounce of power your machine can give you? No need to close your browser. GX Control lets you set limits on how much RAM, CPU and network usage your browser takes up."

> * Macbook 16" from 2019 with2.4 GHz, 8-Core Intel Core i9 with 32 GB 2667 MHz DDR4 RAM and an AMD Radeon Pro 5500M 8GB GPU

Nice specs (32GB RAM) but perhaps not representative of the norm.

Indeed. I'd like to see the same tests on a dual-core from 2015 with 4 GB of RAM. Which is more like what most people use day-to-day.

Depends on the audience.

HN audience wouldn't be too bad.

8 cores and 32 GB of RAM is a seriously big computer. That's close to maxed-out for any off-the-shelf laptop or desktop, especially considering it's using a recent CPU architecture and chipset.

Edit: as of Feb 18, 2021, you can't even buy a 13-inch MBP with 32 GB of RAM. The 16-inch model with 32 GB of RAM and all other specs set to their minimum/default comes out to $2800 on the Apple online store. That is far, far outside the range of what most people have access to.

The 13 inch does, but not the M1. You have to use the Intel ones. That's an issue with Apple/M1. No i9 though on them or dedicated graphics.

My problem with Flotato has been unreliable notifications. No matter how much I fiddle with the settings they oftentimes never appear.

Chrome doing caching and therefore taking some RAM is correct behavior. What's not being measured is if and how much the chrome memory policy is adaptative to system memory contention, i.e If I open another app that make the RAM full, will chrome adapt by doing less future caching, by freeing some of the existing caches, by tuning the JIT to reduce throughout for reduced memory consumption, etc

I don't think Chrome does any of those things on desktop.

Who are these people? No contact information whatsoever on their website. Twitter account inactive since last October. Undated blog posts (this particular one may be several months old).

I'd love to use their product but this doesn't incite confidence.

The bigger problem is that Macbook fans are incredibly noisy. Fan noise is a non-issue on most other laptops. I do agree that chrome is highly unoptimized. Sometimes I wonder if the Chrome team themselves use it as their main browser or not.

If the "Flotato" program sold by this website gets any traction it will immediately get fingerprinted and banned by the bot-detection algo vendors.

Unused ram is wasted ram.

It's not nearly that simple: power consumption, other processes, future processes... are all factors in deciding how much RAM to use and a userspace application simply can't know enough to decide that. And what do you do if it overestimates and you actually need that RAM for something else? The OS doesn't know enough to decide which pages to swap out and swapping isn't the right solution anyways as now your app thinks its cache is in memory but it's actually on the disk. But the OS can't just deallocate pages since it doesn't know which are important.

There's a pretty elegant solution to this that basically all OS use these days: the OS can use additional memory as a disk cache, since IO is still the biggest bottleneck on most systems. Apps can request a file to be cached too (see man 2 readahead), so there's no guessing involved and the app can cooperate with the OS instead of assuming it's the only thing that is or ever will be running and eating up qll resources accordingly.

graphs don't show for me on page

Why do people continue to use Chrome? Inertia? Genuine love for Google's "services"?

UX is quite good as long as you don’t have to edit the settings. Most buggy sites work on it, which is no longer true for Firefox. It’s also very stable and secure.

But it does get slower and slower with each update.

Let’s please remember it’s a trade of space and time... memory vs cpu... I see safari using a lot more cpu then chrome and also being much less responsive when using complex sites... both engines are mature these are trade offs

There's also the security tradeoff. If you put everything in a single process you save a ton of RAM at the expense of security.

Safari appears to use a separate process for each tab.

Oh, there's much more processes than just tab. You also have a separate process for the network stack, the JS engine, the password manager, audio, etc... You can also have one process per extension.

Chromes multiprocess model and arena memory allocators have a massive impact on memory use... But they are also a big security win.

Any browser with a small memory footprint you should ask yourself "if someone manages to find a buffer overflow in this thing, will my bank password be sitting adjacent in memory because the memory allocator is trying to save RAM rather than being security conscious"?

What is the security win you get from arena allocators?

By making sure each type of C++ object is allocated in an arena, then many memory safety issues (use after free, buffer overflow) can only impact objects in the same arena. In Chromium land, they're called Partitions.

That means an attacker has to find some memory safety issue and some code execution issue in the same object. They can't corrupt memory using one flaw and then get code execution by forcing another type of object to be allocated at the same place.

Learn more here: https://chromium.googlesource.com/chromium/src/+/dcc13470a/t...

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact