Setting Memory Priority via Sysinternals
In Sysinternals, the Process Explorer utility can display memory priority (seems to default to 5) and it can both display and set the process (i.e., CPU) priority. Is there any utility that can set the memory priority?
3 answers
Sort by: Newest
-
-
Michael Taylor 48,581 Reputation points
2022-10-18T21:39:14.74+00:00 I'm really curious why you are remotely interested in changing the memory priority of a process. The priority of memory simply determines how important that page of memory is when trimming. There is really no way for you to make that determination yourself as you didn't write the app nor do you know how the app is using the memory. Changing the priority does not impact how much memory is being used by the process and, in fact, may cause performance to get worse if the program is constantly being trimmed.
This low level feature is really designed for programs to use to prioritize their memory usage. For example an app that loads files into memory for perf reasons may mark the thread that manages that memory with a lower priority so it gets written out more frequently than the core process memory. This would be a really extreme example of perf optimization and outside perhaps database apps or similar highly performant programs I cannot imagine why you would ever change this. It gets harder if you have multiple threads working with the same memory because I suspect it is the thread that allocated the page of memory whose priority is used. The process-level priority simply sets the default priority for the threads it creates.
-
KurtBMayer 831 Reputation points
2022-10-18T21:30:58.56+00:00 wmic process where name="CalculatorApp.exe" CALL setpriority "above normal" or $ProcessName = 'CalculatorApp' $process = Get-Process -Name $ProcessName $process.PriorityClass = 'BelowNormal'
See these for more examples:
How to change the priority of a Windows 10 process using Command line?
Process Priority Management in WindowsPlease upvote or accept this thread as answered if it's helpful, thanks!