3

I need to know how to change "memory priority" of a process. I need a utility that changes the memory priority of the process. Certain ram intensive programs can still make my important programs freeze up by sending them to the page file. I need to stop this, and I need to be able to select the EXACT priority of any program. Additionally I am using windows vista.

For reference, I googled, found nothing. Please note that this is not "process priority" or cpu priority. Anyone know of a free tool which does this?

1

3 Answers 3

1

As far as I know there is no way to make sure a process stays in memory on Windows. There is a Win32 API called VirtualAlloc() that will allocate memory in such a way that the memory manager won't try to push it to disk. This have to be coded into the application and can not be set by any program as far as I know. You will probably have much better results by increasing the amount of ram in your computer.

1
  • This answer is correct. I will add that the use of VirtualAlloc to allocate nonpageable virtual memory is a particular option on VirtualAlloc; its use is quite rare, it is somewhat awkward to use, and there are severe restrictions on how such virtual memory can be used by the process. It applies not at all to code, stacks, or heaps, for example. So it doesn't get used much. Aug 30, 2015 at 2:04
3

You can set memory priority with SetProcessInformation:

https://msdn.microsoft.com/en-us/library/windows/desktop/hh448389(v=vs.85).aspx

I have hit problems with working-set draining in processes that accidentally got set to low memory priority in several cases. It's not fun. The restart manager and task scheduler can both end up doing this.

0
1

In Windows the MM will only page-out pages that are not being accessed for some time, also when "Context switch" happens your code will stop running.

It sounds like you either need to write your code in the kernel in High IRQL and access only none paged memory which is a very bad idea, or change the target OS to a real time OS.

1
  • This is correct for processes with normal memory priority, but it is incorrect for processes with low memory priority. In the low memory priority case the working set will be drained in a few minutes. Once the working set is drained to the standby pool it is vulnerable to being paged out due to disk activity. SetProcessInformation can be used to set memory priority. Mar 1, 2018 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .