Is the High Price of RAM a Good Opportunity to Promote FreeBSD?

FreeBSD, thanks to its excellent Virtual Memory System, optimally uses any swap memory you set up (unlike Linux or Windows). You can, for example, set up 8-16 GB of swap memory on a separate disk (or even on the same one), and you will be able to execute a ton of memory-demanding software (your browser with many tabs open, your graphical text editor, spreadsheet, music player) at the same time on your favorite memory-heavy desktop environment (Plasma, Gnome) and even add a couple of Windows or Linux VMs on VirtualBox to the mix, all of this with only 16 GB of RAM. The system will not freeze. Some windows may take a couple of seconds to respond while FreeBSD is restoring their memory from swap, but that's it. If you are using Plasma, as is my case, the window will render in black and white while it's "waking up." I don't know how this works on other DEs. All this describes my experience.
 
When the system begins swapping, having too much swap makes it worse as the system becomes unresponsive. 2GB is the maximum for me. Wish FreeBSD supported Linux's zram to get away with swap partitions. I'm running Debian with OpenZFS on a Raspberry Pi with 8GB RAM using zram with no issues.
 
having too much swap makes it worse as the system becomes unresponsive
Well, this never happened to me. What happens to me is what I described in the original post. I must be a Martian. It was a bad idea to start this thread. It's making me sad to see how wrong I was and how little love there's for the VMS.
 
Well, this never happened to me. What happens to me is what I described in the original post. I must be a Martian. It was a bad idea to start this thread. It's making me sad to see how wrong I was and how little love there's for the VMS.
Life's too short to be sad about stuff like this. Regret only what you didn't do. Let others chime in on their experience with swap on FreeBSD.
 
From my observation (with no measurement) FreeBSD indeed behaves best of the main OSes when there is serious RAM shortage. It just seems to be smarter about when to page out (as opposed to dropping readonly pages) and what to page out.

Linux tends to shoot itself in the foot with aggressively dropping readonly pages instead of paging out. That leads to C, C++ and Rust code not being available when needed. The swappiness parameter doesn't fully help. In addition the kernel OOM killer is too aggressive and gives up too early before swap is full given that SSDs give back pages reasonably fast now. And don't get me started on that piece of shit systemd OOM killer they put in front of the kernel one.
 
Back
Top