Pagefile flip flop

Carfax83

Diamond Member
Nov 1, 2010
6,841
1,536
136
I've been running without a pagefile on my PCs since the days of Windows XP. Every single PC I've ever built had large amounts of RAM (even for gaming PCs), and I always thought, why the feck do I need a pagefile if I have gobs of RAM just sitting there?

I've even advised people on this very forum, to disable the pagefile if they have more RAM than they need..

This line of thought stayed with me for years, and I bet many others that disable their pagefile believe similarly. They want to force Windows to use as much RAM as possible, and stay away from the dreadfully slow (comparatively speaking) HDD/SSD.

So what changed my mind? Despite always having had large quantities of RAM in my machines, there's been a few times over the years when I've gotten warnings from Windows that I was running low on RAM. How could this be I thought, when task manager is showing that I still have lots of available memory left?

My most poignant recollection, was on my previous rig before the current one in my sig. It was an X79 build with 16GB of DDR3 2133 and Windows 8.1. I noticed that if I played several games back to back in short order, I could trigger this warning..

So something was obviously wrong, but I never really gave it much thought until I upgraded to Windows 10. Windows 10 supposedly has much more efficient memory handling than any previous OS from Microsoft. So imagine my surprise when the same damn thing happened again!

But instead of blaming it on my lack of a pagefile, I believed it was some sort of memory leak. And it wasn't an unwarranted belief mind you, as Windows 10 was a newly released OS at the time and it had issues.

I didn't zero in on the pagefile being the culprit until I built my latest X99 build, which has 32GB of RAM.....more memory than I could ever need truth be known, but it was on sale so I bought it.. Although this time I never ever received a low memory warning. What got me thinking, was that I noticed that Windows seemed like it never recovered RAM. Everything I was doing on my PC, would get cached and would remain there.

Then I made the connection that this behavior was what caused my low memory warnings on my previous builds.

So I started researching and I read this interesting thread on superuser.com.

One of the posters named David Schwartz made a compelling argument against disabling the pagefile, and sold me:

No matter how much RAM you have, you want the system to be able to use it efficiently. Having no paging file at all forces the operating system to use RAM inefficiently for two reasons. First, it can't make pages discardable, even if they haven't been either accessed or modified in a very long time, which forces the disk cache to be smaller. Second, it has to reserve physical RAM to back allocations that are very unlikely to ever require it (for example, a private, modifiable file mapping), leading to a case where you can have plenty of free physical RAM and yet allocations are refused to avoid overcommitting.

Consider, for example, if a program makes a writable, private memory mapping of a 4GB file. The OS has to reserve 4GB of RAM for this mapping, because the program could conceivably modify every byte and there's no place but RAM to store it. So immediately, 4GB of RAM is basically wasted (it can be used to cache clean disk pages, but that's about it).

You need to have a page file if you want to get the most out of your RAM, even if it's never used. It acts as an insurance policy that allows the operating system to actually use the RAM it has, rather than having to reserve it for possibilities that are extraordinarily unlikely.

This mirrors my own experience, and answers why I was getting low memory warnings from Windows despite having plenty of available RAM.

Since enabling the pagefile which I have on system managed (windows allocated 4.8GB), I've noticed that games actually slightly MORE memory, around 200-300MB.

So in synopsis, regardless of how much RAM you have, never ever disable the pagefile if you want Windows to use your RAM as efficiently as possible
 

TheRyuu

Diamond Member
Dec 3, 2005
5,479
14
81
So in synopsis, regardless of how much RAM you have, never ever disable the pagefile if you want Windows to use your RAM as efficiently as possible

I thought this was already what people generally regarded as how it should be (for quite some time now as well).

Moral of the story: don't think you know better than the people who wrote the operating system (or driver software). I'm not saying everything that's out there is BS or unwarranted but please take any "tweaks" with a huge grain of salt especially ones which do not provide any evidence (e.g. something "feels" smoother).
 

Ketchup

Elite Member
Sep 1, 2002
14,546
238
106
Disabling the page file is one of the worst pieces of advice that has floated around for years. As if somehow the OS is going to page things it doesn't need to page if you leave it active. Remember that paging is not only about a backup if RAM is crucial, but it's also used as a non-volatile space to store data in the case that things to awry (every hear of a memory dump)?

There is an interesting explanation here:
When an application references memory it does so within the program's virtual address space. In most modern operating systems, each process has its own virtual address space; threads within the same process operate within the same address space. The microprocessor translates the virtual address into a physical address through a process called virtual to physical address translation. The exact mechanism varies from architecture to architecture but most use some form of page table. Intel's x86 microprocessors use a multi-level page table that manages memory in chunks of either 4KiB, 2MiB, or 1GiB called pages. If the requested virtual memory is currently present in the physical address space it will be translated without issue. If the memory has been ejected to a swap volume to make room for other memory the microprocessor generates an interrupt called a page fault. The operating system must then bring the memory from the swap volume into the physical address space and update the requesting process's page table accordingly before continuing.
http://www.tomshardware.com/answers/id-2222708/pagefile-memory-usage.html
 

RLGL

Platinum Member
Jan 8, 2013
2,088
304
126
My experience is the same, I figured this out while still on 7
 

Ketchup

Elite Member
Sep 1, 2002
14,546
238
106
what if you created a ram drive then set that as your page file?

RAM drives made little sense when I had a 486 and was reading my DOS manual, and they still don't make much sense for a home user. Most of the computers I support run on a RAM drive, and that works fine as long as you have them set up to write crash/dump data to another location. Unfortunately, Windows is not written this way, so the protective aspect of a RAM drive is still lost. And if you have an SSD, the performance advantages of doing so are also lost.

Let me put it another way... right now, of the 4 GB of memory I am using, less than 100 MB are being used for paging. I am not going to risk the data loss of a RAM drive over 100 MB.
 

blankslate

Diamond Member
Jun 16, 2008
8,659
491
126
On my newest computer recently upgraded to 16GB RAM I just looked at the recommended size according to MS in the virtual memory and made a fixed one with the minimum and maximum size set to what MS recommends.

The last time I ran windows with no pagefile was with XP after upgraded to 4GB RAM and any performance gains I perceived were probably just a placebo effect.


_______________________
 

JimmiG

Platinum Member
Feb 24, 2005
2,024
112
106
The people who designed your operating system's behavior are not fools. Having a paging file gives the operating system more choices, and it won't make bad ones.

It's a weird one. Do people really think Windows is that stupid?
"Oh, I see you have 6GB of free RAM, but I'll just use the paging file on that 5400 RPM HDD instead because I'm retarded"...
 
Last edited:

hhhd1

Senior member
Apr 8, 2012
667
3
71
what if you created a ram drive then set that as your page file?
That is worse than just disabling the pagefile, because you get the downside of both, having a pagefile and not having a pagefile.

This way, unused memory is still occupying space in pagefile, which is actually on ram, but with the addition of wasted CPU overhead.
 

Auric

Diamond Member
Oct 11, 1999
9,596
2
71
On my newest computer recently upgraded to 16GB RAM I just looked at the recommended size according to MS in the virtual memory and made a fixed one with the minimum and maximum size set to what MS recommends.

A fixed size is practical for HDD if contiguous, and preferably located near the beginning to maximize performance (defragmented after creation). The allocation size should also be 4 KB -so particularly if placed on a secondary HDD where 64 KB is advantageous, a dedicated 4 KB volume is best. However, none of this matters with SSD so may as well leave the size system managed.
 

sm625

Diamond Member
May 6, 2011
8,172
137
106
I stopped disabling the pagefile when my computer crashed several times without it. Windows is already bad as it is, and when you add dozens of 3rd party software memory management techniques (or lack thereof) it can get really ugly really quick.
 

nerp

Diamond Member
Dec 31, 2005
9,866
105
106
Mucking with the pagefile is in the same realm of registry cleaners, defragging, memory 'cleaners' and other tweaks that made sense for Windows 95 v1 but are totally worthless and have been worthless for years and years. Not only does it introduce potential problems, it will not help performance. Yes, MS engineers know better, much like the people who designed the engine in your car know better, so if they say use 87 octane and 93 octane has _no_ benefit, then it has _no_ benefit even if you 'think' putting in higher octane gas makes your car run better. It actually doesn't.
 

Elixer

Lifer
May 7, 2002
10,376
762
126
Have been saying for a long time not to disable the pagefile, guess people are starting to see the light.

Now the question is, should the pagefile be on a SSD or not?
 

John Connor

Lifer
Nov 30, 2012
22,840
617
121
I always make the min and max pagefile 1024. I always did this to not only reduce fragmentation on a platter, but knew that some programs would complain there was no pagefile. Been doing this since XP.
 

blankslate

Diamond Member
Jun 16, 2008
8,659
491
126
Now the question is, should the pagefile be on a SSD or not?

I have the pagefile on the SSD in a laptop with 4GB. If the gigabytes could be 16 I'd try putting it on the HDD in that laptop.

*e2a*
I don't think having the pagefile on the SSD impacts its life too much. In a computer that's on near 24/7 it's used about 1/3 or the writes per day in the average life specifications.


________________
 
Last edited:

nerp

Diamond Member
Dec 31, 2005
9,866
105
106
TIL that defragmentation has been worthless since Windows 95. I guess your esteemed MS engineers must have missed that memo, huh?

What are you talking about? Everyone has known this. They leave it in there for the OCD folks who would have a nervous breakdown if they eliminated the defrag interface.
 

nerp

Diamond Member
Dec 31, 2005
9,866
105
106
I always make the min and max pagefile 1024. I always did this to not only reduce fragmentation on a platter, but knew that some programs would complain there was no pagefile. Been doing this since XP.

The OS has changed a bit since then. Your method might be hurting performance.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |