Live data from Hacker News

Browsers eating RAM

flotato.com

141–150 of 171 posts

Re: Browsers eating RAM

#141
post #78

(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…

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…

> 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).

Re: Browsers eating RAM

#142

Earlier quoted context omitted.

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 (exclusivel…

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.

Re: Browsers eating RAM

#143

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…

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

Re: Browsers eating RAM

#144
post #78

(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…

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…

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.

Re: Browsers eating RAM

#145
post #102
post #87

Earlier quoted context omitted.

Safari + Old Reddit redirection is the way to go here. Now if only there was a way to calm Twitter down...

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/

Re: Browsers eating RAM

#146

Earlier quoted context omitted.

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…

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.

[0]https://bugs.launchpad.net/ubuntu/+source/linux/+bug/159356

Re: Browsers eating RAM

#147
post #80

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 doin…

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

Re: Browsers eating RAM

#148
post #144

Earlier quoted context omitted.

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…

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?

Re: Browsers eating RAM

#149

Earlier quoted context omitted.

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…

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…

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.

Re: Browsers eating RAM

#150
post #78

(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…

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!

Post reply on HN