73 points · by taubek · 3y ago · 119 comments
So I would rather choose a browser with 2x-3x lower benchmark performance if it could consume 2x-3x less memory. Firefox is basically unusable on a 2Gb system as long as you useit more than 15 minutes.
One of the solutions could be to freeze and compress background tabs. There is no need to keep in memory HTTP caches, localstorage, heavy JIT caches, CSS selector dependency trees, JS bytecode, DOM nodes without JS expandos attached. Freezing background tabs also allows to save energy.
> Firefox is basically unusable on a 2Gb system <...>
I just had a look at one of the largest laptop retailers in the UK, and they don't sell laptops with less than 4GB anymore. Checking the steam survey [0] (which is biased towards gamers but still a very representative sample of PC owners and users), almost 95% of people have more than 4GB. Realistically, 2GB and even 4GB devices are at the absolute bottom end of devices that are in use in desktop computing.
Mobile is a different beast, but android has a specific lightweight OS for 2GB devices, and 4GB devices are budget at this stage. 6GB is the requirement for full-fat android. [1]
You may or may not agree that it's necessary, but the reality is that 2GB device are bordering on obsolete in 2022.
> One of the solutions could be to freeze and compress background tabs.
Firefox supports this already [2]
[0] https://store.steampowered.com/hwsurvey/Steam-Hardware-Softw...
[1] https://www.xda-developers.com/android-12-performance-class/
[2] https://support.mozilla.org/en-US/kb/unload-inactive-tabs-sa...
<4GB devices are ~10.6% of the mix. 4GB are 20.8%.
Many people still buy those absolute bottom end of devices.
But of course there are cheaper laptops with 4Gb RAM, so this one seems more like an exception. There are even tablets that cost less and have 12 Gb of RAM, although they are sold by suspicious sellers from China.
That's Bay Trail Atom. Launch date: Q1'14, two years after the platform launch, two years before the platform sees the latest release.
Or this is old new stock (of Bay Trail Atoms?) of something completely insane. Come on, 8 years! I had Acer W4-821 tablet with similar CPU in 2014! And was quite hampered by an upgrade to Win10, though I managed to run Virtual Box with CentOS on it to live test some code.
https://ark.intel.com/content/www/us/en/ark/products/80274/i...
There's absolutely no point in buying new cheap laptops these days.., Big businesses are always getting rid of 5 year old laptops because their 5-year warranty expired, and the prices get low because they're old, but those 5 year old laptops are comparable to 1 year old laptops these days, cause in 2017-2021 there has been 0 improvements in the laptop world...
I wanted to replace my top of the line 2017 Dell XPS 9560 in 2021 after 4 years of use and literally didn't find any laptop that was noticeably better to justify paying for it....
Having two laptops is twice better than having just one, so I decided to continue using it. Maybe I will connect it as a virtual monitor for a second laptop (then 2 Gb should be enough), but I am not sure if Wayland supports this.
Also, even if new laptos have 4+ Gb of RAM, there are still 5-10 years old models in use.
Can you please point out which laptop in 2022 is being sold with 2GB of ram limitation? Really curious.
The smallest I could find for sale in my country is 4GB and I had to look really hard as they're not cheaper than buying something with 8GB of ram or they're just ARM Chromebooks.
Even most budget chinese Android phones rarely ship with less than 4GB of RAM anymore. So you made me very curious about 2GB laptops retailing in 2022.
Edit: wow, why the downvotes guys? Is it against the rules to aske questions?
Limiting RAM has become a silly market segmentation tactic, and I’d say there is absolutely no reason to buy a PC with less than 16 GB of RAM these days. It’s downright stupid you can still buy machines with 6 GB. Better to buy several generations down or used—old CPUs are still perfectly serviceable unless you’re planning to submit to some serious C++/Rust compiler punishment. (Says the person with an 8GB dual-core Haswell that is showing definite signs of obsolescence, but I still stand by my words.)
Also, even 15-year old CPUs are still pretty fast and can do billions arithmetic operations per second. Only because Intel decided not to add several more address lines which cost them basically nothing, these machines have to be thrown away.
You know, people don't have unlimited money.
Of course. I mean that as far as I can see one should normally save on just about everything else, including going back multiple CPU generations (let alone giving up on a discrete GPU) and buying a used laptop instead of a new one (in case it’s a laptop), before opting for less RAM. (I’m not including Chromebooks in this calculation, as those have never been available to me.)
if it's not upgradable then it's up to the user to determine if it's worth it to replace the whole laptop, but if it has 4GB of RAM its other specs are probably gonna be outdated as well and you can buy very good refurbished laptops for under 300€ these days...
Huh? When the system is getting close to running out of memory, isn't the least-recently-used memory swapped out to disk by the OS? And if you're using an SSD like nearly everyone these days, it isn't even noticeable.
Freezing tabs is a good idea to ensure the memory stops being accessed precisely so it can be swapped... but besides this, why not let the browser use all the memory it needs, and just let swap do its job? It seems entirely redundant for a browser to try to save memory by essentially implementing its own secondary swap strategy.
After all least-recently used memory is swapped out, the time comes to swap out recently used memory and it becomes noticeable, especially with a spinning disk with 400Kb/sec random write speed.
Swapping is extremely ineffective. Unloading a tab allows to use sequential write which is orders faster than random write even with SSD.
For keeping things open in the background that aren't being actively used, swapping is extremely effective.
I don't see any good reason why background applications should get swapped out by the OS, but background tabs should be handled by a different mechanism.
(And I have no idea what sequential write has to do with anything...? If you're talking about coming back to an old tab, loading it from swap will nearly always be faster than reloading over the internet, no?)
FF can do it, but it only triggers in low ram situations and detection is wonky, disabled on Linux.
I found the auto tab discard addon [0] to be a game changer on my low ram machine. It just works (though not on mobile).
[0] https://addons.mozilla.org/en-US/firefox/addon/auto-tab-disc...
I would much rather incur a swap load time than a page refresh.
Seems like a reasonable bar to test against. 2GB even a decade ago was very low end.
I've been doing front-end dev for almost 20 years and now use Chromium very rarely and only in work related context.
I'm at the risk of sounding naive here, but using any browser that is not Chrome makes the world a slightly better place (just a tiny bit), same goes with helping your non-techie friends do the same.
(yes, I know Safari is not perfect, but Chrome is cancer/storefront and it is one often things that make use collectively a tiny bit more stupid)
It’s not perfect but the balance of effort versus results is pretty good imho. The only thing I really miss is being able to disable JS per site, instead of globally, which Safari doesn’t allow :/
I gave Safari a try and I loved it, but the lack of Profiles made me switch back to Chrome. I hope they implement such feature in the future.
It's not as good as FF containers or separate profiles in terms of sandboxing/isolation, but in terms of UX it's pretty neat. I keep HN and all of my distractions in one tab group then just hit one key to hide them and only see the work context, all distractions are gone.
This approach works well enough for me because it feels super simple, although I miss FF containers a little bit.
> “Chrome 12 [an old version] was the best Chrome", but since I’ve come to see underneath that for me what I wanted was a fast tight browser, and once I had that, pretty much by definition most subsequent work was just gonna make it worse.
Safari is today’s fast tight browser I dare say.
From the perspective of Google, your browser or your phone are just ad spaces.
Apple sells ads, so that rules out Safari.
Microsoft sells ads, so no Edge or Internet Explorer.
Mozilla sells ads, so no Firefox.
Brave sells ads, so no Brave.
What’s left? Lynx?
Think of it this way: what percentage of the revenue of each of these businesses comes from advertising? Where can you put your (understandably) limited trust given the limited list of options?
There's a huge difference between the incentives of Alphabet and, _say_, Mozilla from the revenue source pov.
> Microsoft sells ads
> Mozilla sells ads
what?
Anyone have ideas why the tab's memory contents can't be offloaded to SSD and restored instead? Personally I don't like losing state (e.g. filled in forms, scroll position, deleted posts, etc) from using other extensions like Great Suspender.
For comparison, if you don't unload the page completely, and system gets into swapping then there will be random access pattern with speed about 400 Kb/s on a HDD. So it is faster to unload 500 Mb sequentially than swap out/in 5 Mb.
2. it's very messy data, it's a bunch of seas of nodes (the DOM, the JS heap, the styling info, etc...)
3. I wouldn't be surprised if it was data which isn't fully isolated (e.g. shared style caches), meaning it first has to be fully forked to resolve into a self-contained bundle
OS have the ability to just freeze and store / restore memory, but I'm not sure they give that capability to use processes.
Image-based systems (smalltalk, self) would probably be a better model for a live tab, but it still requires things to line up.
Chromium already discarded tabs when the system memory pressure was high, what the memory saver brings is a smarter policy [0]. For example, tabs that are inactive for more than two hours will be automatically discarded now.
[0] https://source.chromium.org/chromium/chromium/src/+/main:chr...
1: Load NBC.com (or any other regular media site) in a "naked" web browser (just a plain browser, no ad blocking, noscript etc)
2: Open dev tools -> networking tab
3: Study the activity, look at requests made, size of requests, data the requests contain (remember, YOU are paying for these requests in terms of impact to battery, bandwidth, electricity usage etc)
I can see MB's of data transferred from my device, every time I scroll more network activity is performed (100's of requests per MINUTE), this is all made possible by "JS" which is the single biggest resource hog of any modern browser.
Turning JS off (whilst obviously crippling some pages) results in HUGE savings of bandwidth, reducing battery impact AND increasing privacy :). (You can also use noscript to allow/deny certain scripts from loading, and you'll be surprised how many pages work with JUST the root domain enabled, thus every third party script is not vital to the functioning of the page)
I seriously think modern browsers (including Firefox) need to implement features to reduce the amount of network requests a page can make, including to third party websites, and limit the amount of data a single page can consume. I'd call it a "browser firewall" similar to tracking mode, preventing third party requests entirely
Data does cost, contrary to what others make think, especially on mobile lines when out and about.
So yeah, let's fix that first.
Since I upgraded a couple days ago, I'm seeing that indeed every tab completely reloads when I switch to it if I haven't used it in a few hours.
But now I'm kinda worried that I'll leave something half-written and it'll be gone. Unfortunately there doesn't seem to be any way to test that in advance without waiting a few hours.
I also often rely on a long article being scrolled halfway through to save my place, or a long video I'm in the middle of, and I'm worried that my spot will be lost as well.
I find it extremely odd that they're not even mentioning anything about that -- e.g. whether you will lose data/place and you should disable this feature if that's unacceptable, or whether it does some fancy stuff to restore the state of anything that's a form, contenteditable, scroll position, or playback location.
There should be a middle ground that can pause all resource use, and then resume it, without reloading state. Google, Amazon, Twitter, Youtube subframe/embeds are resource hogs.
So many times a page has an infinite paint loop that sucks 100% of a cpu core, and I with I could just… turn the dial down a bit to save the battery.
Here’s hoping that energy saver lives up to its name.
Feels weird to have the performance control inside an application, instead of it following what has been set by the OS.
OS are general-purpose system, it's always been the case that applications being known workload they had better knowledge of what they need (it just doesn't matter to most of them). That's why you can tune your db configuration, or you can police individual processes using various tunables, or you can ship your program with a better allocator than f'ng glibc malloc.
And a modern browser is a pretty complicated process manager, the OS has no understanding of what the various processes do or what state they're in.