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...
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.
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.
Now, not so much. Dev machines rarely run out of RAM anyway.
> 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).
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).
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?
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.
> 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.
would be a nice operating system feature
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!
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 ), 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.
 https://web-confluence.appspot.com/#!/confluence see "Browser-Specific" tab
> half the comments on the post, didn't question these _wildly_ different results though...