Understanding Maximum Dynamic Memory from inside a VM

Dynamic memory is a great feature that allows Hyper-V administrators to get better utilization of their physical memory.  But it can be hard to tell what is going on from inside of a virtual machine.  There are, however, some things that you can do from inside a virtual machine.

The first thing you can do is see how much memory is currently available to your virtual machine.  This is just the free memory as is displayed in Task Manager inside the guest operating system:


Beyond this, if you are running Windows 8 or later, you can also see what the maximum memory is set at for your virtual machine.  In the screenshot above you can see that the Maximum memory of this virtual machine is set to 4GB.

You can also access the information about the maximum memory configured inside of a virtual machine by looking at the Maximum Memory, Mbytes performance counter off of the Hyper-V Dynamic Memory Integration Service using Performance Monitor.


Finally, you can access this information using PowerShell:


Running the following command inside of a virtual machine:

(get-counter "\Hyper-v Dynamic Memory Integration Service\Maximum Memory, Mbytes").CounterSamples.CookedValue

Will tell you what the maximum memory for that virtual machine is configured to.