7/3/2026 at 7:03:42 PM
Linux vm defaults are legit insane in 2026.- system dies under memory pressure (regardless of swapping, actually not having swap makes it worse which should be common knowledge by now)
- system dies under disk pressure even if there are tons of free memory (this one is fun to diagnose)
- system can technically not die, but render itself useless (or worse) under memory pressure by the oom killer
- memory compression of any sort is not enabled
- ...
Both Windows and macOS do so much better out of the box for essentially any workload.
by baq
7/4/2026 at 2:50:45 AM
> Both Windows and macOS do so much better out of the box for essentially any workload.We test FreeBSD, Linux, macOS, NetBSD, OpenBSD, and Windows in Zig's CI fleet. Of these, Windows is the only OS that we've had to configure with swap double the size of physical RAM to not hit completely unjustifiable OOMs.
By "unjustifiable", I mean that we're not even close to actually running out of physical memory (let alone swap), but the MM seems to be doing a horrible job of making unused memory actually available to processes.
It's possible there's a relevant configuration knob here that we're just not aware of... but the point is, the default behavior does in fact suck.
by alexrp
7/4/2026 at 1:55:13 PM
Windows will autogrow the page file (*swap file is separate from a page file in Windows; swap is exclusively for UWP apps) as needed.It sounds like the application wanted to allocate contiguous regions of memory when none were available. That's a typical indicator of an 'early' OOM condition.
by 0x1d7
7/4/2026 at 5:42:15 PM
When will people learn?NT is optimized, since day one, to swap.
This is a feature, not a bug.
by swappie
7/4/2026 at 4:02:53 AM
Windows seems to work a lot better with a 16MB page file for whatever reason, just because it refuses to enable memory compression without it. Fucking stupidby LoganDark
7/4/2026 at 4:30:35 PM
It might be shocking but so does Linux (though 16MB won’t cut it) and all other OSesby baq
7/4/2026 at 9:39:47 AM
My curiosity is piqued. What reason did you have to disable the page file?by psd1
7/4/2026 at 3:07:11 PM
128GB of system memory?by LoganDark
7/3/2026 at 7:19:32 PM
The mm people are increasingly hostile to any method of handling OOMs (like, just failing the allocation) besides the OOM killer - it's become very dominated by the hyperscalars and cloud vendors.Working around mm nuttiness is a frequent source of frustration.
by koverstreet
7/4/2026 at 8:42:36 AM
There is no point in managing memory allocations as they have little relation to actual memory usage. There are also other methods than the OOM killer to handle OOM, like process throttling using cgroups "memory.high" limits.by man8alexd
7/3/2026 at 11:04:33 PM
mm?by layer8
7/3/2026 at 11:18:15 PM
I believe koverstreet is referring to the Linux kernel Memory Management subsystem (https://docs.kernel.org/mm/index.html)by callahad
7/4/2026 at 2:57:11 AM
Kernel oomkiller is useless for the desktop. It only cares about kernel survival. There's user space oom options, like oomd, earlyoom ... but I'm not sure any heuristic really knows what user space program to clobber.Resource control via cgroupsv2 sounds better for both desktop and server use cases, differing by what processes receive minimum resources. But IO isolation remains elusive. Some suggest a database of hardware capabilities, I wonder if a cheap estimator of throughput and latencies could do this dynamically.
Anyway, I'm not convinced user space should care about or rely on the kernel oomkiller. Well before it even considers the situation human interactivity with the system was lost.
by cmurf
7/4/2026 at 9:20:15 AM
> Well before it even considers the situation human interactivity with the system was lost."Are you logged on to DB1?"
"...yes?"
"What did you do, it just died"
This has happened multiple times
by psd1
7/3/2026 at 10:51:11 PM
Yeah I noticed and was surprised after using ec2 that it didnt really have a sizable swap so it would lock up if I used enough memory importing a db export. Was genuinely surprised.by giancarlostoro
7/4/2026 at 12:51:41 AM
What are better defaults for 2026+?by pyinstallwoes
7/4/2026 at 10:32:43 AM
start with a couple gigs of swap, fixed size sub-gig dirty buffers, enable zram, enable an oom daemon with some sane default configuration like 'kill X, wayland, sshd and shells last and browsers and node processes first'for some more user sanity huge ram consumers under memory pressure should be suspended, paged out as much as possible and the user notified (macOS does it right)
by baq