0

Is there a built-in mechanism within windows to lower and increase the amount of memory that a process is allowed to use? I want programs to be able to sometimes think there is less ram available than there actually is and other times be able to just use whatever ram is actually available on the computer.

user64742
  • 247
  • Maybe this answer can help you: https://superuser.com/questions/44003/how-do-i-give-a-program-high-priority-for-memory-and-processor-speed – neo Jul 31 '21 at 20:22
  • @neo Sadly, it does not. – user64742 Jul 31 '21 at 20:24
  • What about https://superuser.com/questions/753928/limit-the-available-ram-that-a-program-app-sees-in-windows?rq=1 – Mokubai Jul 31 '21 at 21:18
  • @Mokubai No, none of those answers are built-in native to windows features and none of those can change the memory cap at runtime on demand. They all just set up sandboxing with fixed memory caps. – user64742 Jul 31 '21 at 21:23
  • 1
    Then the answer is probably a simple "No. Use another tool." Windows (and pretty much any OS) intends for applications to be well written and use the memory they require. – Mokubai Jul 31 '21 at 21:25
  • Alternatively if you have Windows 10 Pro and use the Windows Sandbox you could use that to limit memory... https://superuser.com/questions/1512458/windows-sandbox-memory-limit?rq=1 – Mokubai Jul 31 '21 at 21:28
  • More options at https://superuser.com/questions/1263090/is-it-possible-to-limit-the-memory-usage-of-a-particular-process-on-windows – Mokubai Jul 31 '21 at 21:29
  • @Mokubai I’m not dealing with any poorly written applications. I just wish to deliberately prevent some programs from in certain instances getting the memory they request in order to analyze the resulting behavior. I was told though that the results are only useful “if it can be done with native windows”. So it looks like I’m going to have to keep searching for a way to load up a lot of memory… in windows itself. – user64742 Jul 31 '21 at 22:01
  • How do you define "native"? Job objects are a built-in Windows feature (going back to WinXP) which can set memory and working set limits for the contained process, yet Windows doesn't come with a pre-made .exe tool that would let you run processes as jobs directly from Cmd – if you need an external program to activate a built-in feature, does that make it non-native? – u1686_grawity Jul 31 '21 at 23:08
  • @user1686 I honestly have no idea. – user64742 Aug 01 '21 at 02:33
  • What's the thinking behind this? So long as there's room on the hard drive, windows will keep ramping up the swap memory [of course making the entire machine slower]. If you hard allocate memory [for instance by removing the swap], then when it runs out, the app [or Windows] will just crash unforgivingly. If you want to see this in action, just run a 32-bit OS - in VM if you have to. – Tetsujin Aug 01 '21 at 11:13

1 Answers1

0

The easiest way to reduce the RAM is to create a RAM disk that will eat up some amount of the RAM.

Some free products that I found (but never used):

harrymc
  • 480,290