6 ms·
From my experience, Windows does freeze and become completely unusable too, just not usually from RAM usage hitting 100%. I don't use Windows much, nor do I ca
by mtgh2s 2mo ago
From my experience, Windows does freeze and become completely unusable too, just not usually from RAM usage hitting 100%.
I don't use Windows much, nor do I care much about that environment, but from what I've seen it seems to keep RAM usage below 100% most of the time. What I do see pretty often is the drive getting stuck at 100% usage instead, which makes the whole system ridiculously unusable anyway.
- W3zzy 2mo agoHaven't had Windows freeze on me for ages. I had a frozen linux server that ran out of RAM yesterday.
- LtWorf 2mo agoUse a windows server then :D
- W3zzy 2mo agoNah, I'm not complaining. I love the freedom of Linux. I'm fairly new at the game so today I'll be teaching myself how not to mess up like this again.
- mtgh2s 2mo agoedit: I meant that regularly hitting OOM on a production server is usually more of a provisioning/resource-management issue. Obviously, how the OS handles OOM once it happens is still its responsibility. Running out of memory on a linux server sounds more like a skill issue than something comparable to how a desktop OS should behave :\
- W3zzy 2mo agoCould be. I'm new to the game. Started homelabbing a year ad a half ago. Thing is that I never know this could happen. As a Windows user I'm used to a system that does stuff in the background without knowing how it works. My Linux VM's can be broken because I'm in charge and I'm a noob. I kind of love it. I've learned so much from troubleshooting.
- ASalazarMX 2mo ago> I had a frozen linux server that ran out of RAM yesterday This has so many variables that it's practically useless as a data point. We have a few Ubuntu VMs running complex business web applications and their Postgres database on only 4 GB or RAM and 20-50 GB of storage, no swap space. Ocassional high load, but Zero OOM problems for many years. We could upgrade the RAM, but we were stingy when we created them, and it has worked well so far, so why waste resources? Incidentally, using no swap was a deliberate choice, as it would slow things down too much. We preferred to see and correct any memory/OOM issues beforehand, but fortunately we had none.
- W3zzy 2mo agoTrue. It's just a tiny Lenovo that I've repurposed as a homelab and that is punching above it's weight with to many applications I suppose. Either way the logs point to RAM issues but it could be my incompetence.
- Espressosaurus 2mo agoWindows uses eager memory allocation, and applications will die when they allocate (and think image editor loads a beefy image) or fail to start when it runs out of memory. Linux uses lazy allocation and overcommits, so what dies isn’t necessarily what you would expect thanks to the OOM killer. With a fixed swap size windows doesn’t necessarily slow down as it runs out of memory. YMMV if you don’t have 64 gigs of RAM and a 64 gig swap.
- manwe150 2mo agoThe difference is Linux has fork, while Windows doesn’t, so Linux cannot do accurate accounting (without wasting a lot of memory) while Windows can.
- coliveira 2mo agoThis is the best explanation, thanks.
- pjmlp 2mo agomacOS is a UNIX as well, and it isn't the only UNIX that manages to do accounting properly.
- hnlmorg 2mo agomacOS includes a GUI user land whereas Linux is just a kernel. So Apple can build a whole user-controlled GUI workflow around memory exceptions, which Linux cannot. Maybe what needs to happen is new Linux syscalls + signals for DEs to utilise for building memory exception UIs? But the problem then with that is you’re impacting the portability of those DEs. So some maintainers might still refuse to work with Linux to provide this. That all said, I’m pretty sure KDE does provide GUI tools for when this kind of scenario arises.
- pjmlp 2mo agoI mentioned they aren't the only UNIX where this isn't a problem. Also we cannot use the reasoning Linux means distributions, instead of using GNU/Linux for it, and other times Linux is just the kernel, depending on convenience.
- vablings 2mo agoWindows will aggressively page out as you approach RAM usage, MacOS does the same but based on activity iirc. On Linux if you just set up paging (forgot how i did this on arch) you won't have any issues.
- da_chicken 2mo agoWindows does freeze and become unstable, but it's usually because of some ring 0 errors not getting trapped appropriately. But Windows has always handled both OOM and out of disk space very well. The system will be extremely sluggish, but it typically continues operating. The Linux design is to keep using memory, then push to swap, and then when you OOM you hard lock. The built in kernel OOM module can miss when RAM usage spikes rapidly. You can enable OOM monitors like systemd-oomd or earlyoom, but they do not run by default, and their behavior is to term the offending process. The thing about Windows is that when you request memory, you're only granted memory if it can be guaranteed in the first place. The application will get a "not enough memory" error. On Linux, you're permitted to request more memory than the system actually has, with the idea that you won't actually use that much memory. It's optimistic that way. But if you do use it, then you're screwed.
- akdev1l 2mo agoLinux can be configured to disable memory overcommit sysctl -w vm.overcommit_memory=2 sysctl -w vm.overcommit_ratio=50 It is probably a bad idea to do that though as it will limit the amount of virtual address space an application can use
- yayachiken 2mo agoNote that the fork()/execve() semantics of Linux pretty much depend on memory overcommit. You may get weird OOM crashes when there is seemingly no memory pressure, if you turn overcommit off. In the short time between fork() and execve(), the new process duplicates the entire virtual memory of the old one. None of this is physically allocated due to copy-on-write, but still all counts as virtual memory.
- Dylan16807 2mo agoHas anybody tried a compromise? Like, the program forks and overcommit is ignored for it for a 1 second grace period? I know it would be more complicated than that, but something along those general lines.
- 2mo ago
- Avamander 2mo agoI have never had Windows fail so catastrophically as Linux does on OOM or disk exhaustion. Many distros probably still fail to boot with a full disk. Linux OOM handling is just atrocious.