How does Hyper-V Dynamic Memory work?

Author by Nathan Lasnoski

The Hyper-V team announced that in Hyper-V R2 SP1, they will be providing dynamic memory.  So, what is Dynamic Memory?  Is that just like "overcommit"?   The short answer is "not really", its better.  Dynamic Memory is a way for the hypervisor to over-subscribe the memory resources to virtual machines, not overcommit them.   It is not a way for virtual machines to use more memory than is in the box.  It is essentially a way for the virtual machines to share the memory resources of the hardware in a more effective way.   It is essentially allowing the Hyper-V platform to dole out resources as virtual machines require, vs. being constrained to fixed resources. How does it work?
  • Memory is "hot added" to guest operating systems through the "synthetic memory driver".
  • This is "not hardware emulation"
  • Memory is "removed" through ballooning (essentially excluded, but still present)
What are the parent requirements of hosts for dynamic memory?
  • Windows Server 2008 R2 SP1
  • Microsoft Hyper-V Server 2008 R2 SP1
What are the systems requirements of guests for dynamic memory?
  • Windows Server 2003, 2008, and 2008 R2 (32 and 64 bit)
  • Windows 7 and Vista (32 and 64 bit)
  • Requires the integration components
What are the controls around the dynamic memory?
  • Startup RAM (shown to BIOS, used to boot)
  • Maximum RAM  (maximum the machine is allowed to use)
  • Memory buffer (free memory to keep in the virtual machine)
  • Memory weight  (used to set virtual machine priority when systems compete for resources)
What are the operational metrics shown in Hyper-V Manager?
  • Assigned Memory.  This shows the physical memory "allocated to the virtual machine at this time" 
  • Memory Demand.  This shows the memory requested by the virtual machine to meet processing demands.
  • Memory Status.  Shows how much of the buffer amount is available for the virtual machine to use.  This status is shown as either "OK", "Low", and "Warning".  
What happens when we run out or memory?
  • The guest will intelligently page-out to obtain virtual memory (from disk) that it can use.
How do I monitor Dynamic Memory?
  • Find "Dynamic Memory VM" under the performance monitor tool.  In select a counter, such as "Guest Visable Physical Memory"
  • Utilize operations manager to monitor the Dynamic Memory allocation centrally.
Can I use SCVMM?
  • Yes!  You do however need to deploy SCVMM SP1, which brings control over the new features.
How is this different than VMWare?
  • Microsoft builds on top of the guest operating system knowledge and the integration components directly integrate with the DM process.  The Hyper-V and Windows Kernel memory management teams also work directly together on memory management, which provides a consistent end-to-end platform.   Another significant difference is that DM uses guest directed page sharing, vs. random host paging.
  • VMware does not trust the guest memory information.   Memory management is entirely done in a "black box" manner. 
To view Ben Armstrong's Tech Ed presentation on the topic, you can check it out here: To see Jeff Woolsey's walk through on page sharing, you can check it out here: Here is some great documentation on the Dynamic Memory features.  Take special account to review the minimum startup RAM: Nathan Lasnoski

Nathan Lasnoski

Chief Technology Officer