I don't even remember having to reboot any desktop FreeBSD installation in my life and I been around FreeBSD machines for over a decade and half. On production servers under load of many many many users it happened maybe 3 times total out of these 2 times it was most likely due to hardware malfunction and other one because hitting some sysctl limits - I don't remember more details. While desktop Linux distributions get hiccups and freezes regularly merely from running firefox or some desktop software that starts having memory leaks after running for few days.<p>Why there is such huge disproportion?
I believe the symptomatic behavior of the two operating systems you are describing are the default choices around overcommit ratios and bytes and reserved memory and this only starts to become a problem when one is using more memory than what is installed.<p>Linux is by default very forgiving, to a fault. That fault being an application can ask for more memory than what is available and will use a simple formula to permit it. BSD is stricter by default on over-commit, thus keeping some people out of trouble at the risk of denying an application's request for more memory. This is really only a problem if the person is forking more processes and requesting more memory than what is installed and available.<p>Take a look at your committed memory and available memory:<p><pre><code> grep Com /proc/meminfo; free -m
</code></pre>
Assuming this is what you are running into on Linux this behavior can be disabled using<p><pre><code> # vm.overcommit_ratio = 50 # is the default (mem+swap*1.5)
vm.overcommit_ratio = 0
</code></pre>
in /etc/sysctl.conf or adjust as you see fit and then running <i>sysctl -p</i> or rebooting. There are other tunables that can prevent swapping or start swapping early depending on what behavior one prefers and how much memory is installed in the system in question. There are also tunables for reserving memory for root and for the kernel but I will avoid going down that rabbit hole without knowing your setup.
> While desktop Linux distributions get hiccups and freezes regularly<p>This may be caused by the "desktop environment" you are running and not Linux itself.<p>I do not run DE's (simply Fvwm2, no 'desktop environment') and this Linux machine I'm typing on has a record uptime of 475 days, and a current uptime of 110 days. Most often it gets rebooted due to a power cut that lasts longer than the UPS contains energy to last through.<p>My Linux pvr has a current uptime of 414 days (and this length is also its record uptime).<p>My Linux firewall/router has a record uptime of 616 days and a current uptime of 49 days (and this 49 days was caused by the previous motherboard dying and necessitating a motherboard replacement).<p>Another Linux desktop machine, also running only Fvwm2, has a current, and record, uptime of 243 days. It as well most often is rebooted only due to power cuts beyond the ability of the UPS to keep the system running.<p>So my experience is the exact opposite of yours -- Linux is rock solid and does not "get hiccups and freezes regularly".
If you’re restarting your Linux distro regularly, there’s something wrong with your setup.<p>In fact, force rebooting is a thing of the past in most platforms, and has been for decades. Even Windows is reasonable stable.