(Last Modified: 06/10/2024)
It's not possible they said! You can't just run Firefox with dozens of tabs open on a modern Linux distribution on a computer with a mere 256MiB of RAM.
Well guess what, I DID! (with some caveats...)
I have seen people trying this experiment with vintage computers, but it's usually the same thing and comes with significant drawbacks:
Okay, we all know you're not going to be able to run Photoshop or modern video games on a complete potato like this. However, it is actually viable to browse the modern internet, have a IRC and email client open, and write code all at the same time with only 256MiB of RAM. In fact, you can probably make do with less if you're running NetBSD or a lightweight Linux distribution (unfortunately, the Linux kernel panics if you have less than 128MiB of RAM on x86). I haven't tried doing this experiment on NetBSD yet, but it's something I'm looking forward to do in the future.
In order for this to work, I had to disable (or neuter?) some significant security features on Firefox. I don't recommend doing this at all for an actual production machine you're storing sensitive information on. I claim no responsibility for what happens to your computer(s) as a result of this guide. With that out of the way, let's proceed!
First, let's start off with what I'm using. I am running i386 Debian 12 under VirtualBox with 1 vCPU and 256MiB of RAM. Unfortunately, I don't have any very old computers or laptops around at the moment, so for now using a virtual machine will suffice. If you do try it under real hardware, please send me an email and tell me how it went! :)
I'm running DWM as my window manager (I think it's the least bloated window manager for X but I have no evidence to back up that claim), XTerm for my terminal emulator, and "standard" Firefox, with a few adjustments of course. I tried using Sway, which I think consumes even less resources, but I was met with an unfortunate black screen. If you're not into using tiling window managers, you can get away with something like LXDE as well.
For Firefox, you'll have to install UMatrix. This extension is an absolute godsend and puts UBlock Origin to shame. Without it, your computer will begin to struggle with even just a few tabs open (including for non-interactive sites). To minimize as much resource consumption as possible you'll want to block everything by default and only whitelist CSS for first party domains like this:
Of course, you can whitelist certain things as needed for sites that require interaction. Just try to keep it to a minimum. You may be wondering though, doesn't this render the browser completely useless? Won't I have to whitelist every single site I come across? To the best of my knowledge, no you don't. I have used UMatrix on my main computer with a similar configuration (with images and media whitelisted by default for first parties) and all mainstream commercial websites work fine as long as you're not using it interactively. You can also just whitelist a site temporaily (or permanently, if you use visit it often) which you can't do with the other lightweight browser alternatives.
You can also install an extension like LibRedirect which I highly recommend doing as this will redirect to you to frontends that don't require Javascript and are lightweight. This will allow you to navigate Reddit, Twitter, StackOverflow, and other bloated websites very comfortably. For a search engine, I recommend using DuckDuckGo Lite. And as always, remember to disable telemetry, Pocket, and other garbage Mozilla adds into Firefox for the best experience.
Next, you'll want to modify some important about:config settings (WARNING: THIS IS DANGEROUS!):
dom.ipc.processCount = 1
extensions.webextensions.remote = false
layers.gpu-process.enabled = false
media.rdd-process.enabled = false
browser.tabs.remote.separatePrivilegedContentProcess = false
browser.tabs.remote.separateFileUriProcess = false
fission.autostart = false
As for what this does, it mostly minimizes the number of processes Firefox is allowed to run, and disables Fission. This saves a significant amount of memory, but it has significant security risks. Once again, only set these settings if you know what you're doing.
Ok, admittedly, it lags a ton (even on my overpowered CPU and I am using swap). One day, in the near future, I'll buy some actual old computer to test this experiment on. Nonetheless, it's very impressive to see all these tabs loaded in memory and using 65% of my total memory. Granted I am not running heavy sites, but you can run one (or two if you're lucky) bloated websites and get away with it. I tried it with Discord and it seemed to work fine. Obviously, my choice of Linux distribution wasn't the best one but given the lack of time I have right now, I figured it was a nice start to an interesting ongoing series. :)