Live data from Hacker News

Linux 7.3 improves performance when running out of vRAM

pixelcluster.dev

201–210 of 328 posts

Re: Linux 7.3 improves performance when running out of vRAM

#201

I hope there will be an update where when my RAM gets full my PC doesn't freeze and becomes unusable... I remember that Linux and Windows do this in different ways and Windows doesn't have the problem.

This gripe (that I literally crashed out on recently after maining Fedora for the first time) is top of my list for annoyance/frustration with Linux as a desktop. I now have btop permanently running in a Terminal and I habitually Alt-Tab to it to watch my swap. As soon as my free memory gets less than 1 Gb I kill any Firefox tabs (the memory black hole). I know this won't be popular, but Linux people have some kind o…

Just ask any of the last gen coding agents to fix this for you and they'll make a script that tweaks a few things and it just works.

Is it acceptable? No. Did it solve my endless crashes that I used to get every day? Yes.

I don't love Ubuntu, I just hate modern Windows and find my ubuntu for work popos for gaming setup to be better for me. Ymmv.

Re: Linux 7.3 improves performance when running out of vRAM

#202

I see all the comments about how Windows and Linux handle OOM, but I suppose I'll also mention macOS. On my M4 Max Mac Studio if I try to load too big of an AI model with protections off, the desktop starts glitching back and forth between the past few hundred frames. It looks bad when it happens but CtrlC still works to kill llama.cpp and if you were using LM Studio, SSH also works. Once you kill the offending proce…

On my M4 Max MacBook Pro, if I run or even load an LLM more than a couple times, even a small one, general desktop performance starts to get really, really bad until a reboot and I don't know why. Genuinely, everything starts feeling super sluggish, even long after the process has terminated -- cmd+tab gets slow, apps constantly hang for a few seconds at a time, the cursor position starts lagging and videos are slow…

macOS's OOM manager suspends and pages out processes when it hits a hard OOM event, and then usually (though not always) brings up a window to help you decide what to kill. However, once you do that, you have to then resume those processes that were suspended using that OOM window. If you don't do that (or if the process is terminated for you without the OOM window showing up, then a restart is the simplest solution to restart those processes.

Re: Linux 7.3 improves performance when running out of vRAM

#203

Earlier quoted context omitted.

Windows 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…

The difference is Linux has fork, while Windows doesn’t, so Linux cannot do accurate accounting (without wasting a lot of memory) while Windows can.

This is the best explanation, thanks.

Re: Linux 7.3 improves performance when running out of vRAM

#204
post #131
post #74

Earlier quoted context omitted.

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.

Macs are also real bad at handling low disk space. I don’t how other OSes do but the best advice on a Mac is to always have a decent amount free. What’s a decent amount? No idea. Don’t test it :)

Both MacOS and Windows start having issues if you have less than 10% of the disk free. The problem with the Mac is your ~/Library/Application support/ folder can get huge and take up a ton of space. Mine is currently at 55GB

Re: Linux 7.3 improves performance when running out of vRAM

#205

I hope there will be an update where when my RAM gets full my PC doesn't freeze and becomes unusable... I remember that Linux and Windows do this in different ways and Windows doesn't have the problem.

Linux might freeze from occasional OOMs, but Windows is sluggish and unresponsive even when RAM is far from full with all its unnecessary background processes. That's the difference for me.

Re: Linux 7.3 improves performance when running out of vRAM

#206
post #172

Earlier quoted context omitted.

Windows 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…

Doesn't Windows, like macOS, automatically expand swap? You can't run out of memory nearly as quickly as you can on Linux. And at least on Windows I always figured this is why it felt so sluggish under load--it ends up paging alot. Not sure why macOS has always felt more consistent; perhaps the OS and major apps are less gratuitous memory hogs?

If you're referring to Apple Silicon, my intuition is that the SoC design allows for higher bandwidth between SSD and RAM which reduces the performance impact of paging. I might be totally wrong though

Re: Linux 7.3 improves performance when running out of vRAM

#207
post #11

Gosh, 7.2 literally just dropped with a bunch of awesome of performance/gaming related improvements (large folios, cache-aware scheduling, improved MGLRU reclaiming, Fair GPU Scheduler etc)... and I already can't wait for 7.3 to come out. Meanwhile in the Windows world, users hate updates... Like I genuinely can't think of a single instance that made users exclaim, "oh boy I just can't wait for the next Patch Tuesday…

I mean, Windows has managed to fix a lot of gaming/GPU stuff like this lately as well. They properly support HDR, VRR and even VRR with bornderless mode on older games - all of which has been very buggy and broken on Linux for a long time. Not to mention actually working eGPU support - trying to use DaVinci on Linux with eGPU still ends up with "Not enough GPU" errors and constant crashes.

This goes especially when used with more powerful GPUs from nVidia - so perhaps arrogance here isn't warranted?

Re: Linux 7.3 improves performance when running out of vRAM

#208

I hope there will be an update where when my RAM gets full my PC doesn't freeze and becomes unusable... I remember that Linux and Windows do this in different ways and Windows doesn't have the problem.

Wait, how does literally no one in this thread mention swap?

IME, many default installations in recent years don't configure swap by default. Dedicate a few tens-of-gigabytes on your hard drive and memory overflows there instead of borking.

Re: Linux 7.3 improves performance when running out of vRAM

#209

I hope there will be an update where when my RAM gets full my PC doesn't freeze and becomes unusable... I remember that Linux and Windows do this in different ways and Windows doesn't have the problem.

This gripe (that I literally crashed out on recently after maining Fedora for the first time) is top of my list for annoyance/frustration with Linux as a desktop. I now have btop permanently running in a Terminal and I habitually Alt-Tab to it to watch my swap. As soon as my free memory gets less than 1 Gb I kill any Firefox tabs (the memory black hole). I know this won't be popular, but Linux people have some kind o…

I'm ashamed to daily run Ubuntu at home with Chrome (a dozen tabs), Firefox (literally hundreds of tabs, but only a few active), Thunderbird, RSSGuard, whatever I'm currently working with, and sometimes Steam and a AAA game on top of that. Never felt the need to close anything, but I must confess I have 64 Gb of RAM.

At work I ran the same Firefox profile in Windows, with 16 GB of RAM, it used to eat RAM more eagerly, and restarting only helped for a few hours. I never understood why, but GMail and WhatsApp tabs were usually the biggest memory drains.

I'm just happy I don't have to deal with that anymore, since we were moved to iMacs at work, and the same Firefox profile gives no trouble with 24 Gb or RAM. WhatsApp is still the hungriest tab, but it stabilizes. Maybe there's a sweet spot between which tabs are opened and how much RAM do you have?

Re: Linux 7.3 improves performance when running out of vRAM

#210
post #96
post #92

Earlier quoted context omitted.

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.

Haven't had Windows freeze on me for ages. I had a frozen linux server that ran out of RAM yesterday.

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

Post reply on HN