Partager via


Server Virtualization Series: Virtual Memory Management: Dynamic Memory-Much Different Than Memory Over Commit – Become a Virtualization Expert (Part 3 of 20) by Dan Stolts

A common question I get from folks who are looking to purchase new server hardware to run Server Virtualization workloads is where to spend the money – memory or processor. I find that in most cases, processor is not the bottleneck, but memory definitely is the limiting factor for how many VMs you can run at a time on a hypervisor host. The next common follow up to that is then around how Microsoft handles memory compared to VMware. In Hyper-V, we support Dynamic memory whereas VMware uses memory overcommit. 

In Part 3 of the Server Virtualization Series, Dan Stolts does a great job of explaining how Dynamic Memory works in Hyper-V and then compares this to VMware’s memory overcommit. I am including a brief snippet from Dan’s post below, but you will definitely want to read Dan’s full article.


Hyper-V 3 which is built into both the Free Hyper-V Server 2012 and Windows Server 2012 (Standard and Datacenter) which you can evaluate for free (free ISO, free VHD), has some really awesome capabilities. You can read more about Hyper-V in the overview of the Server Virtualization Series: Hyper-V Basics. In this article, we are going to drill down into what I think is one of the best features of Hyper-V. A feature called Dynamic Memory. Dynamic memory has significantly changed the world of server virtualization. As part of the discussion, we will also cover memory virtualization on other platforms so you get a solid understanding of the very, very important concept of “Virtual Memory” . In addition in keeping with the theme of the Server Virtualization Series we will sprinkle in Step-By-Step & How-To’s so you can do it yourself. Dynamic Memory is an optional feature that you can turn on and off with a simple checkbox. With Dynamic Memory you can attain higher consolidation numbers with improved reliability for restart operations. This can lead to lower costs, especially in environments that have many idle or low-load virtual machines, such as pooled VDI environments. Dynamic Memory run-time configuration changes can reduce downtime and provide increased agility to respond to requirement changes. For more on runtime configuration changes see Kevin Remde’s blog post You Want to Hot-Add What?! : 20+ Days of Server Virtualization (Part 2 of 20). If you have not yet installed Hyper-V you can follow the Hands-On-Lab guide at https://itproguru.com/hol it is the “Install/Enable and Configure Hyper-V Getting Started” lab.

Inside Dynamic Memory

What is Dynamic Memory?

Dynamic memory was introduced in Windows Server 2008 R2 with SP1. It gave the Hyper-V hypervisor the capability to dynamically adjust the amount of memory assigned to a machine based on memory demand. The reason we would want to do this is simple. If we can put only the amount of memory a machine needs in the box, we can fit more machines on a host. How’s that? When you deploy a server you give it the amount of memory you think it will need at it’s maximum load. So if when the server is the busiest it needs 4gb of memory it will have what it needs. But, what if that server is only busy for an hour a week? That is a waste of the 4gb of memory. Dynamic memory allows Hyper-V to “Dynamically Reallocate” that memory to other servers that may need it. Then when it needs the memory it can simply dynamically reallocate it back.

An important concept that you need to know about dynamic memory is that it is not the same as “memory overcommit.” Dynamic memory is a much more accurate term to use for it because Hyper-V dynamically “allocates” memory based on workload “demand” In this article, all of these terms and distinctions will be clearly defined. Hyper-V DOES NOT OVERCOMMIT! One of the biggest problems with “memory overcommit” is what happens under memory pressure. When a server runs out of memory it pages (swaps to disk). This is a very costly (slow performance) transaction so Hyper-V will not page at the host (with one very small exception shown below). If there is going to be paging it has to be at the guest and only on the lower priority servers.

Dynamic memory is constantly managing memory. Some call this a disadvantage because it is always working. I do not see it that way. I actually see it as a huge advantage. First, the probability of getting in a low memory state is much lower because Hyper-V is constantly watching demand and tweaking things for optimum performance. Second, when there is memory pressure it does not have to do all that extra work to sort things out while in a starving situation. Finally, dynamic memory has minimal overhead to keep memory managed as opposed to getting memory under control when you have no memory available to work with.

The most important thing to understand about Dynamic memory is that you can run more virtual machines with it. Let’s say you have a 32gb of physical memory in your server; you look at task manager and you see that you are using 31gb or memory. If you have another machine that needs 2gb of memory can you start it? Answer: YES! Hyper-V will simply take “buffer” memory away from other machines to give you the memory you need to run the machine. If you need to start another 4gb server can you? Answer: Yes! As long as you have (or can get) physical memory you can start more machines. Hyper-V will grab buffer memory first, then available memory and finally it will grab real memory from lower priority machines to give you the memory you need to start your machines. If you do not have any of these (Hopefully you do not run things that tight), then the machine will not start.

Dynamic Memory Requirements?

Dynamic Memory requires the following:

§ Windows Server 2012 or Hyper-V Server 2012 (click links for free downloads) {Windows 2008 R2 SP1 or above; Windows 8 or above}

§ Hyper-V role.

§ Hyper-V Guest with Integration Components installed

§ Dynamic memory configured in the guest settings

Dynamic memory works with OLD OS’s (eg. Windows Server 2003) as well as new OS’s (Windows 8/2012) running as a guest on Hyper-V. You can find a complete compatibility list here. This incredible technology is added with the Integration components.

How To add the integration component and enable Dynamic Memory on Windows Server 2003 or other Operating Systems

1. Open the Virtual Machine Connection (Double-Click the machine in Hyper-V Manager)

2. Click the Action menu the select “Insert Integration Services Setup Disks

3. Login to the server and run the Setup from the Integration Services Setup CD (if you get a message about uninstalling a previous version, go ahead and do it)

4. You may then have to restart the server, once you do that, the newest integration components will be available including Dynamic Memory.

How To: Enable and Configure Dynamic Memory

Enable Dynamic Memory in Hyper-V Manager under the settings for the Virtual Machine {guest}

1. Open Hyper-V Manager. {Start Keyboard Button – Hyper-V Manager}

2. Click on your Host Machine Name in the left pane {This will display your Virtual Machines; if you do not have virtual machines, you will need to create them. see the lab “Install/Enable and Configure Hyper-V Getting Started” at https://itproguru.com/hol}

3. Right-Click Guest Machine Name {in the right pane) and choose Settings. {This will open the box shown below}

4. Click Memory – Turn on checkbox Enable Dynamic Memory then adjust settings as desired. See explanation of settings below

5. Click Apply or OK

clip_image002[6]


Harold Wong