We help IT Professionals succeed at work.

Paging File Size in Virtual Machine

144 Views
1 Endorsement
Last Modified: 2018-12-05
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?
Comment
Watch Question

Alpha Geek
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
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 Officer
CERTIFIED EXPERT

Commented:
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.
Mike SchrockIT Operations Manager
CERTIFIED EXPERT

Commented:
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.

Author

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 SchrockIT Operations Manager
CERTIFIED EXPERT

Commented:
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.

Author

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 SchrockIT Operations Manager
CERTIFIED EXPERT

Commented:
@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.
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
@serialband
Thanks for your insight.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.