upvote
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.

reply
Haven't had Windows freeze on me for ages. I had a frozen linux server that ran out of RAM yesterday.
reply
Use a windows server then :D
reply
Running out of memory on a linux server sounds more like a skill issue than something comparable to how a desktop OS should behave :\
reply
> Windows doesn't have the problem

Maybe not in the same way then.

Anyways, you've unlocked an old memory of mine, where Windows would crap itself due to low RAM and the fonts and interface elements would render in a "compatible" way, like using "fixedsys" font everywhere.

reply
Its not enabled by default, but enabling MGLRU setting /sys/kernel/mm/lru_gen/min_ttl_ms to 70 has entirely resolved the issue for me. It _does_ usually pick firefox or vscode to kill, but my system remains interactive, with no need for earlyoom.

Docs https://docs.kernel.org/admin-guide/mm/multigen_lru.html#thr...

reply
Me too, but you can improve the behavior yourself too. It's been an issue with desktop linux and the default settings for a long time. You could maybe tune OOM killer settings, but another option is to use a package like earlyoom: https://man.archlinux.org/man/earlyoom.1.en
reply
For me Windows becomes unusable as soon as any of my drives is being hammered, including when it is swapping, but not limited to it.
reply
Explorer freezes too when an external hard drive spins up, very annoying.
reply
Solaris family kernels move this problem to run/allocation time, instead of waiting for the system to become unusable before trying to do something about it. Kinda nice
reply
Are these directly comparable, though? Doesn't Windows default to using free space on the system drive to grow the swap file in case of memory pressure? Linux has you set up swap files/partitions explicitly.
reply
Also the way memory allocation in Windows works is that if it doesn't actually have the physical RAM (extended by pagefile) then the program will crash.

If you disable pagefile (like I did for some of my servers) and your program mallocs more than what you have in available space (even without ever dirtying a page) you will observe this.

I'm sure that this helps Windows a lot, even if it's not counted as actually used until the page is dirty.

Linux programs very often have virtual addresses many times the amount of physical ram, because there's never been any restriction. It's then very easy to just malloc huge chunks and use what you need and don't care about it too much.

Especially with many "tiny" allocations, python for example has huge sized objects which consume gobs of RAM dynamically, so any long running python process not only fragments memory but ends up having a bunch of objects consuming virtual memory...

idk why I felt the need to rant about this, but it's a difference that I've noted.

reply
Yes, Windows doesn't overcommit memory. In the default config Windows is allowed to grow the page file as much as it wants, and empty pages are cheap to reserve in the page file (no need to actually write those zeros, you just need to reserve space for them). So the end effect is comparable, with the difference that software shouldn't just go ahead and ask for gigabytes of memory it doesn't actually need

I prefer the Windows approach, it's more predictable and has better behavior under memory pressure. But it can cause issues with software written under the assumption that the OS uses memory overcommit

reply
earlyoom is what you're looking for. it'll crash the process instead of hang
reply
When my RAM gets full the kernel kills Firefox (3 profiles) so the PC becomes unusable, with lost data.
reply
use a browser that saves tabs on disk like zen browser I sometimes stop it when playing games since it will preserve tab state
reply
Windows absolutely does have this problem.
reply
zswap and systemd-oomd/earlyoom are your friends.
reply
macOS too sadly. by the time you realise there's a problem the machine is already comatose and unresponsive

all these electron apps and invisible virtual machines (looking at you Claude) really don't help.

reply
One of the biggest reason I migrated to Codex. I'd like to see each agentic CLI process as a simple building block, and having 100 claude session means I sometimes run out of memory (and I have 256GB of them). Codex never have this problem.

The communication is more direct too with GPT5.6 family of LLM. No more belt and suspenders.

reply
deleted
reply