Hacker News new | ask | show | jobs
by alexrp 29 days ago
> 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.

3 comments

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.

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 stupid
It might be shocking but so does Linux (though 16MB won’t cut it) and all other OSes
My curiosity is piqued. What reason did you have to disable the page file?
128GB of system memory?
That might remove a reason to not do it
Am I missing some sort of common-sense explanation of why page files are so great? I have enough system memory that I shouldn't need to spill it to disk.
No, that's not the common sense you are missing ;-)

Your system your rules. But you twiddled a knob to appease your tweak imp, you didn't like the new behaviour, so you called it "fucking stupid". My experience is that the windows vmm is a very high quality component, so simple heuristics tells me PEBCAK.

I can think of two different possible reasons why memory compression might require a page file. Until you understand the technical reasoning, you don't know whether the design is stupid or clever. So taking a strong position is _eliding over a core tenet of wisdom_

You have a lot of unused anonymous memory that is better swapped out and used as a file cache. Specifically for Linux swap, see https://chrisdown.name/2018/01/02/in-defence-of-swap.html
When will people learn?

NT is optimized, since day one, to swap.

This is a feature, not a bug.

> NT is optimized, since day one, to swap.

I'm not sure what point you're making here. Did you assume we had the page file disabled or something?

> This is a feature, not a bug.

OOMing when there's tens of gigabytes of unused memory is a feature...?