3 ms·
I found this paragraph particularly interesting: > Trimming the working set of a process doesn’t actually save memory. It just moves the memory from the workin
by Varriount 3y ago
I found this paragraph particularly interesting:
> Trimming the working set of a process doesn’t actually save memory. It just moves the memory from the working set of the process to the standby list. Then, if the system is under memory pressure the pages in the standby list are eligible to be compressed, or discarded (if unmodified and backed by a file), or written to the page file. But “eligible” is doing a lot of heavy lifting in that sentence. The OS doesn’t immediately do anything with the page, generally speaking. And, if the system has gobs of free and available memory then it may never do anything with the page, making the trimming pointless. The memory isn’t “saved”, it’s just moved from one list to another. It’s the digital equivalent of paper shuffling.
I'd always been under the impression that as soon as memory was trimmed from the working set. Perhaps this was the case at some point, and was a reason for the PROCESS_MODE_BACKGROUND_BEGIN priority? As the blog mentions, the SetPriorityClass call has had this behavior since at least 2015, though I wouldn't be surprised if this behavior has existed for much longer.
As for why this "bug" hasn't been fixed, my guess is that it's due to a couple of factors:
- Windows has become fairly good over the years at keeping the core UI responsive even when the system is under heavy load.
- There are plenty of ways to reduce memory/CPU usage that don't involve a call to SetPriorityClass. I'd wager that setting a process's priority class is not the first thing that would come to mind.
- As a result of the previous two points, the actual number of programs using that call is quite small. I'd actually be interested in knowing what, if any, parts of Windows use it.
(As a side note, if there was a bug in a Windows API function, how would you even report it?
- Bjartr 3y ago> Windows has become fairly good over the years at keeping the core UI responsive even when the system is under heavy load. I would say that's debatable. There are fewer complete freezes that require a restart, but things like the task manager (can't get much more core than that), which used to be instantly available and responsive if the machine was recoverable at all, now can take tens of seconds to show up and and respond to interactions under heavy load.
- ComputerGuru 3y agoLaunching it no longer uses a software interrupt request.