Paging File Size in Virtual Machine

Virtual MemoryI have Windows 2012R2 as virtual machine in Hyper-V  environment and assigned 14GB memory to it.
However when I check the paging file size, it is only 2GB(2176MB) when it is set to manage the size "automatically".
I thought the paging file size is supposed to be minimum physical memory size.
Should I keep it as it is or change?
LVL 1
sgleeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mal OsborneAlpha GeekCommented:
Personally, I set the page file to zero on virtualised machines. Decades ago, when 64 bit architectures did not exist,  ram was expensive and machines were never virtual it made sense, but it really does little on modern setups. Having several VMs thrashing the swap space on a single RAID array brings everything to a crawl.

Just make sure you have adequate ram.

One exception here would be if you need to create a full memory dump, but this is pretty  uncommon, and a swap file can be configured quickly if needed for that.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
serialbandCommented:
I second the removal of the page file.  It was created at a time when RAM was expensive and Windows needed twice as much RAM as was typically available on a desktop system.  By the time RAM got to 4GB, I started reducing the RAM usage, and kept it less than 2 GB.  For servers, I turned it off and bought enough RAM to make sure that I would never go over the physical RAM limit in normal daily use.

I have never had to examine the dump file, as I am not a progroammer/developer, nor am I a bug hunter or reverse engineer.  The vast majority of the time, nobody ever looks at a memory dump.  If you turn of the paging file, you don't really lose anything.  Windows will just complain that it's out of RAM and needs to quit the program, if it attempts to exceed the physical RAM.  This somewhat prevents runaway processes that would end up in swap and slow down the system.
Edmond HawilaChief Operating OfficerCommented:
Hi,
Find the detailed information for this by Microsoft here: https://support.microsoft.com/en-us/help/2860880/how-to-determine-the-appropriate-page-file-size-for-64-bit-versions-of

But as mentioned, if you don't need the crash dumps just disable this and ensure you assign enough RAM.
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Mike SchrockSr. Systems AdministratorCommented:
Quick rundown of how the Paging files worked in Windows over the years (starting with 2003)
Both Mal Osborne and serialband are correct in stating with 64 bit OS's and RAM becoming more and more the less paging files are needed.
In Server 2003 (x86) I believe the calc's were x1.5 (so 4GB ram = 6GB Paging File Size)
     I reckon they used the same logic in Desktop OS's as well
So then came the great RAM price drop of mid to late 2000's and x64 OS's
Now in 2008 they also kept the 1.5 page file to RAM ratio so when we loaded these boxes with 16GB of RAM now we have a 24GB paging file in which only a fraction of the space was ever used. Loop in SSD drives and premium space was expensive you either moved the paging file off or reduced it.
Microsoft reworked paging files in 2012 and 2016 as discovered in your post, they take up little space and are flexible (if needed). Feel free to remove completely, limit, or leave alone, the choice is up to you.
sgleeAuthor Commented:
So remove paging files from ANY OS (Windows 2008, 2012, 2016, SBS2011) whether they are Physical or Virtual machines as long as there are a plenty of physical RAM?
Mike SchrockSr. Systems AdministratorCommented:
I've never removed a paging file from a physical server, these days with 2012//2016 I just leave it on system managed size on VM or Physical, haven't had a problem with space or anything.
sgleeAuthor Commented:
@Mike,
 
 I am the same way. I set up virtual machines and don't pay attention to paging file assuming that Windows OS will allocate whatever it needs. In fact, when I check all my VMs last night, I noticed that paging files were small. Much smaller than the amount of RAM that i assigned to VMs.
Mike SchrockSr. Systems AdministratorCommented:
@Sglee
Right, Microsoft reworked how Paging files get their memory assigned. I dont know the exact math on it, however I know it is no longer a x1.5 of RAM you have and seems dynamic if it needs to be expanded. Even on Win10 how, my 32GB desktop has a 4GB page file (586MB used). A Server 2012R2 (VM) w/ 8GB has a 8GB paging file allocated but only 216MB used. Server 2016 (VM) 12GB RAM has 1856MB Paging File. Again not sure of the math or whatever they used, but it sure doesn't suck up the amount it used to.
serialbandCommented:
Those instructions for 1.5 times physical RAM were already obsolete when 4GB were standard on desktop systems.  It just took them another 10 years to catch up on updating the instructions.  I monitored the page files and found it to be sufficient with 2 GB or less.  If you start needing more, you should purchase more RAM.  You have not needed 1.5x RAM for swap starting when 2 GB was standard.  I just allocated 2 GB.  The last time I ever allocated 1.5x RAM for swap was when 1GB RAM standard.  Those instructions had been obsolete for far too long.  By around 2003, I had already stopped following that ludicrous "requirement" for swap.

Going above 2GB in page file size caused a tremendous slowdown on systems, due to heavy disk access.  Up to 2 GB was ok, when you have software that isn't heavily used and can swap out.  Even with 8GB RAM, I wouldn't allocate more than 3GB swap.  When I was able to get enough RAM, I just turned off swap.

Swap means going to disk.  That slows down your system.  That slows down all the other VMs that also use swap.  If you can allocate enough RAM, then give it the proper amount.  Hardly anyone uses that dump file.  Most sysadmins just delete them to make space.  If that's the case, why create them in the first place?  When you do need a dump file, you can always turn on swap later.

I only ever had 2 server run up against RAM, and those were caused by runaway processes.  If I had enabled swap, the system would have become excruciatingly slow, while I wrestled with regaining control until swap filled up.  I've had it happen to my desktop more frequently, but that was mostly due to poorly programmed Java and javascript crashing browsers.  If I had swap enabled, I would have had to wait until swap filled up before I could stop the system.

Size RAM correctly and you don't need swap.  I usually turn of swap because I do monitor my system RAM usage.
sgleeAuthor Commented:
@serialband
Thanks for your insight.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Virtualization

From novice to tech pro — start learning today.