[SOLVED] Does increasing page file size make the system utilize more virtual memory over physical memory?

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
I was able to open 4 browsers and a medium-RAM demanding game with about 9.1/11.8GB total usage and close to 85% physical RAM usage.

Currently I have 8GB of physical RAM and 4096mb of page file.

I am asking this question because I do not plan on buying anymore RAM for my system.

If I were to increase the page file size, would the system use less of the physical RAM and more of the virtual memory which in turn reduces performance? Is there some kind of % threshold for physical RAM that the system prefers if it can use more virtual memory?

In my situation is it best to leave the page file as it is if I want more performance when playing games even with close to 85% physical RAM usage?
 
Solution
What I'm asking is if let's say you set the page file to an extremely large size like 32GB, would having a page file that big make the system utilize more of that virtual memory or stay the same?
That would make virtual memory operations more taxing to the system. It would not make system to use more virtual memory.
Virtual memory gets used as much as necessary.

Also I'm wondering about how page file writes to the drive.
Let's say the page file being used is 2GB, would 2GB be written to the drive each time it is being utilized?
Pagefile usually gets accessed with large sequential writes and lots of small random reads.
It doesn't get overwritten on every write access.

While we're here do you know if hibernating...
If I were to increase the page file size, would the system use less of the physical RAM and more of the virtual memory which in turn reduces performance?
System uses virtual memory, when you don't have enough of physical memory.
Larger pagefile does decrease performance. It's best to set pagefile to small initial size, but to allow it to grow, if necessary.

In my situation is it best to leave the page file as it is if I want more performance when playing games even with close to 85% physical RAM usage?
In your situation best is to get more physical ram. 8GB ram is not enough for gaming. But since you don't intend to do that, then leave everything as is.
 
  • Like
Reactions: ShangWang
Drivers and kernels all use physical RAM only. User space applications (such as web browsers and games) can "pretend" that virtual memory (physical RAM plus swap) is real RAM. Note that the swap is much slower.

EDIT: Note that any time your game uses swap it will slow it down. The twist in the story is that if OTHER software gives up physical RAM and uses swap, then your game might run faster due to more physical RAM being available. I don't think there is much of a way to predict if your game will run slower or faster without knowing what other applications might give up physical RAM, and that's hard to predict.
 
  • Like
Reactions: ShangWang

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
System uses virtual memory, when you don't have enough of physical memory.
Larger pagefile does decrease performance. It's best to set pagefile to small initial size, but to allow it to grow, if necessary.


In your situation best is to get more physical ram. 8GB ram is not enough for gaming. But since you don't intend to do that, then leave everything as is.
Thank you, but in general I believe page file is used regardless if physical RAM does not get close to 50% usage.

To confirm larger page file decreases performance because more virtual RAM is preferred to be utilized in the setting that the same number of programs were to be run correct?
 
Thank you, but in general I believe page file is used regardless if physical RAM does not get close to 50% usage.
If you have enough ram, pagefile is used very minimally.

To confirm larger page file decreases performance because more virtual RAM is preferred to be utilized in the setting that the same number of programs were to be run correct?
Didn't quite understand, what you're asking here.
Management of larger pagefile uses more more system resources. And this impacts performance. The more system uses pagefile, the more performance hit you get.
This is especially noticeable, if pagefile is placed on a mechanical HDD (with SSD this is less noticeable).

You want virtual memory to be used as little as possible. But you can not disable it. If you try to do that, you get crashes and various virtual memory errors.
That's why, it's essential to have enough physical ram.
 
  • Like
Reactions: ShangWang

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
If you have enough ram, pagefile is used very minimally.


Didn't quite understand, what you're asking here.
Management of larger pagefile uses more more system resources. And this impacts performance. The more system uses pagefile, the more performance hit you get.
This is especially noticeable, if pagefile is placed on a mechanical HDD (with SSD this is less noticeable).

You want virtual memory to be used as little as possible. But you can not disable it. If you try to do that, you get crashes and various virtual memory errors.
That's why, it's essential to have enough physical ram.
Sounds good, I'll just keep page file to a minimum then.

What I'm asking is if let's say you set the page file to an extremely large size like 32GB, would having a page file that big make the system utilize more of that virtual memory or stay the same?

Also I'm wondering about how page file writes to the drive.
Let's say the page file being used is 2GB, would 2GB be written to the drive each time it is being utilized?

While we're here do you know if hibernating would write more to the drive than restarting? I used Winbootinfo and saw only about 49.6mb were written on startup.
 
I was able to open 4 browsers and a medium-RAM demanding game with about 9.1/11.8GB total usage and close to 85% physical RAM usage.

Currently I have 8GB of physical RAM and 4096mb of page file.

I am asking this question because I do not plan on buying anymore RAM for my system.

If I were to increase the page file size, would the system use less of the physical RAM and more of the virtual memory which in turn reduces performance? Is there some kind of % threshold for physical RAM that the system prefers if it can use more virtual memory?

In my situation is it best to leave the page file as it is if I want more performance when playing games even with close to 85% physical RAM usage?
Because we run different stuff I don't think there is a one size fits all answer.

Run your stuff and watch the perf and page file usage.
Now double the page file size and run your stuff watch the perf and page file usage.
If there is a meaningful diff in perf pick the best one.

I suspect if you want better perf you will need to bump the ram to 16GB.
 
What I'm asking is if let's say you set the page file to an extremely large size like 32GB, would having a page file that big make the system utilize more of that virtual memory or stay the same?
That would make virtual memory operations more taxing to the system. It would not make system to use more virtual memory.
Virtual memory gets used as much as necessary.

Also I'm wondering about how page file writes to the drive.
Let's say the page file being used is 2GB, would 2GB be written to the drive each time it is being utilized?
Pagefile usually gets accessed with large sequential writes and lots of small random reads.
It doesn't get overwritten on every write access.

While we're here do you know if hibernating would write more to the drive than restarting?
Sure. On hibernation contents of memory gets written to hiberfile. That causes more writes.
 
  • Like
Reactions: ShangWang
Solution

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
That would make virtual memory operations more taxing to the system. It would not make system to use more virtual memory.
Virtual memory gets used as much as necessary.


Pagefile usually gets accessed with large sequential writes and lots of small random reads.
It doesn't get overwritten on every write access.


Sure. On hibernation contents of memory gets written to hiberfile. That causes more writes.
Thank you very much, one last thing:

Although not perfect, do you think 9.1/11.8GB total usage and around 80% physical ram used while playing a game and browsers being open leaves enough available RAM to be used by other system processes, and won't really have a big hit on performance compared to increasing the page file?
 
Although not perfect, do you think 9.1/11.8GB total usage and around 80% physical ram used while playing a game and browsers being open leaves enough available RAM to be used by other system processes, and won't really have a big hit on performance compared to increasing the page file?
That means, you have to increase physical ram. To 12GB minimum, 16GB recommended.

But since youre totally against that, then expect slowdowns, frame drops, stutters while gaming.
 

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
That means, you have to increase physical ram. To 12GB minimum, 16GB recommended.

But since youre totally against that, then expect slowdowns, frame drops, stutters while gaming.
Yep, I would have to upgrade but if I leave about 2GB of RAM total free that should be fine even with page file and any amount of RAM in general?
 
Last edited:

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
If you have enough ram, pagefile is used very minimally.
Management of larger pagefile uses more more system resources.
Hello, sorry for bringing this thread up again, but I wanted to confirm something since it's been bothering me again lately.

When you mean "management" do you mean the ACTUAL usage of the page file or just HAVING a large TOTAL page file?

I'm pretty sure just having a large page file takes up drive space and not things like CPU and RAM.
 
I'm pretty sure just having a large page file takes up drive space and not things like CPU and RAM.
Having a large pagefile impacts system performance negatively. This is especially noticeable with pagefile placed on a mechanical HDD.
You want pagefile as small as possible, as large as necessary. So it doesn't have to be resized all the time.
With pagefile placed on SSD performance impact is less noticeable.
 

ShangWang

Respectable
Mar 26, 2021
616
2
1,885
Having a large pagefile impacts system performance negatively. This is especially noticeable with pagefile placed on a mechanical HDD.
You want pagefile as small as possible, as large as necessary. So it doesn't have to be resized all the time.
With pagefile placed on SSD performance impact is less noticeable.
Thank you, but could you explain how just having a page file that's large impacts it negatively other than just taking up space?
 
could you explain how just having a page file that's large impacts it negatively other than just taking up space?
That's because of the way, pagefile gets accessed.
Access usually is a lot of small random reads and few large sequential writes.
On a mechanical HDD random reads are extremely slow.
The larger the pagefile and more fragmented it is, the more time it takes to position read head to next random read location
(as opposed to situation, when pagefile is small and compact).

This is not really a problem. if pagefile is placed on SSD.
But by placing pagefile on SSD you cause extra write cycles and SSD will wear out significantly sooner.
 
  • Like
Reactions: ShangWang