Exploring Swap on FreeBSD
klarasystems.com
klarasystems.com
I think this is reason enough to enable swap even if you do not plan on using swap for system memory. It's always nice to have a memory dump if the system crashes so you can check what the issue was and correct it. If you wouldn't want to fix those kinds of issues why would you be running FreeBSD anyway?
Not being facetious -- if you operate entirely within RAM (as if you had disabled swap), then it won't really be used much.
This is one reason I went with an 8Gb RAM Mac recently. If I go into swap territory occasionally it's not really a big issue. As yet as a terminal node, which is what it really is, I barely ever touch swap even with a ton of things open.
Because it's a stable, robust, feature rich system, and I'm happy to benefit from that without being an OS developer.
On the other hand, I have run continuously, 24/7, for almost 20 years a FreeBSD server without any swap and without ever seeing any crash or panic. In my opinion the swap is useless and it is better to just install enough physical memory.
I reboot that system just once a year or so, for a kernel update or a hardware upgrade.
I run on it a large number of services, mostly Internet related, e.g. firewall, router, NTP server, DNS server for outside, DNS resolver for the internal network, e-mail server, Web server, Web proxy, file server.
However just because your software allocates data in memory doesn't mean it needs to be there. Rarely used memory could be swapped out to cache more frequently used files on disk instead, increasing the overall throughput of the system. This could be true whether or not you have an excess of physical memory for your workload.
None of my FreeBSD systems have swapped anything out in years. Most of the VMs get half gig of "I guess it might by used by something" swap space.
Somewhat ironically NVME would be insanely good for historical swap use cases but anything that cares about performance hasn't swapped in the better part of a decade.
This might sound like obnoxious question. But I genuinely don't know benefits of FreeBSD, have been using Linux virtual machines all my life.