Setting Memory Priority via Sysinternals

Liam Bowen 1 Reputation point

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?

Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,112 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. KurtBMayer 836 Reputation points

    @Liam Bowen

    wmic process where name="CalculatorApp.exe" CALL setpriority "above normal"  
    $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 Windows

    Please upvote or accept this thread as answered if it's helpful, thanks!

  2. Michael Taylor 49,871 Reputation points

    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.

  3. Castorix31 82,321 Reputation points
    0 comments No comments