Save RAM by forcing a program to use page file

2.1k Views Asked by At

I was running game servers and when they have no players running, I wanted to put the servers' memory into the page file to save RAM.

I do know that Windows puts memory that wasn't accessed recently into the page file, however the jobs done with 0 players by these game servers do not have high urgency.

As far as jobs that the game servers need to do even with 0 players, I'm willing to test that myself and see if running it in the page file will cause a problem, so I don't need to be told if it's a bad idea unless it absolutely won't be reasonable.

1

There are 1 best solutions below

1
On

The operating system will do a far better job than you can at managing its page file, and if your process is idle and the physical memory is in use, it will already be paged out. There isn't normally any need to control this process manually.

However, if your process is going to sleep and you want to tell Windows to put your process's memory on ice as soon as possible, you can adjust its working set size using SetProcessWorkingSetSize.