7 ms·
> does fork–exec copy all the process's memory NT: Yes? Why not? (note that this refers to the Windows NT kernel's operation because it had historically a POS
by zinekeller 4mo ago
> does fork–exec copy all the process's memory
NT: Yes? Why not?
(note that this refers to the Windows NT kernel's operation because it had historically a POSIX emulation layer (NT Personalities), not the modern WSL which is just Linux in a Hyper-V)
- adgjlsfhk1 4mo agobecause this is what causes Windows to use ~80% more memory than unixes
- tosti 4mo agoProcesses are usually spawned with CreateProcess. There's no fork in win32.
- magicalhippo 4mo agoWell, in that case it's a good thing I guess. Windows is orders of magnitude better when it comes to memory management on the desktop compared to Linux. Like why would I even want a single process killed by OOM killer? On Windows things just work, or get slow. On Linux it works and then mayhem ensues. Last year I was writing a reply on a forum in Firefox on Linux when the OOM killer decided to nuke Firefox. Poof gone, mid keystroke. How does anyone think that's acceptable? This was on a stock Linux distro, nothing special.
- ChocolateGod 4mo ago> Windows is orders of magnitude better when it comes to memory management on the desktop compared to Linux. The bar is pretty low, but the windows scheduler is aware what the currently focussed app is so it can prioritise not killing it. On Linux? Not so much.
- zinekeller 4mo agoActually, it depends on the Windows scheduler settings. On Windows Server, the default is to kill the foreground process (on the assumption that it is just a management app rather than a critical server component).
- magicalhippo 4mo agoIn either case, Windows tries a lot of things to avoid killing processes. Which at least in a desktop setting is an infinitely better approach than random beheadings without warning.
- adgjlsfhk1 4mo agoyeah. a lot of the issue with Linux's approach is that until recently, the kernel was the one making the choice, and it doesn't know which processes matter. The part Linus does a lot better if not getting to oom in the first place (and with the newish compressed ram stuff is getting even better)
- jkrejcha 4mo agoWindows doesn't use fork/exec for process creation in any relevant way today There are Native APIs for implementing fork (needed for the obsolete POSIX subsystem, primarily), but even on the Native API side, processes are usually spawned through NtCreateProcess or RtlCreateUserProcess, though there is a bunch of setup with regards to the Csr APIs for the Win32 CreateProcess[1]). [1]: https://stackoverflow.com/a/69605729/2805120 https://stackoverflow.com/a/69605729/2805120