Hyper-V Dynamic Memory

Hunt, Kode 1 Reputation point
2021-08-19T17:28:45.423+00:00

I have a Hyper-V host (Server 2019 1809) with a VM (Server 2019 1809) configured as such.
124755-image.png

However it seems the dynamic memory piece is not working as the VM is reporting very high memory usage:
124794-image.png

But the Host is reporting a much lower demand:

124801-image.png

I assume the VM is not getting more memory dynamically assigned to it as the host is only reporting a 3GB demand, though the VM is saying it's using 7GB+.

Why this discrepancy in reporting and why is the Host not giving the VM more memory when its running close to 90% utilization?

I'm assuming I have something configure wrong or simply don't understand the reporting that I'm seeing. Any help is much appreciated.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,636 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Eric Siron 1,256 Reputation points MVP
    2021-08-23T15:26:35.123+00:00

    Demand/in use/assigned do not have a direct relationship. You cannot accurately predict what one will look like by looking at any other.
    The Hyper-V "assigned" field will always tell you exactly what physical memory the guest currently owns.
    The Hyper-V "demand" field is reported by the memory manager in the guest. Demand can be lower or higher than "in use" or "assigned".
    The guest "in use" displays are correct as far as the guest's memory manager knows. When Dynamic Memory takes from a guest, it does so by "expanding" the "memory" that it consumes inside the guest. So, the guest shows a larger "in use" value but in reality Hyper-V has taken that memory away. I highly doubt that's what's going on here because your total memory size as reported by the guest is the same as your "startup" value, meaning that Hyper-V has not taken anything away. However, the tools you have used do not show that information.
    Use RAMMap from SysInternals. Some of what it shows as "driver locked" might be used by Dynamic Memory.

    It's not expanding in this case because it has no reason to expand. Demand is low and 90% utilization is less than 100%. A high percentage of consumed memory is only bad when you don't have anything that should be using a lot of memory. If you've got a high memory app and it's using most but not all of the memory, then that's good resource utilization.

    If you were expected the app to use more memory, then that might have something to do with the nature of "demand". Memory management is an exact science, but figuring out "demand" is a bit more nebulous. Most apps just ask for memory when they need it and release it when they don't. Others, usually server apps, allocate a large pool at startup and only release it at shutdown. Their developers build algorithms to decide how much to ask for. So, if you have an app that starts up and follows a memory allocation algorithm of: "how much is there, how much can I have, I'll take x% of that," then it only "sees" 8GB available at startup because that's your startup memory value. If it thinks that's the cap, then it will ask for a lower number than it could technically have. From that point onward, its "demand" will be fixed at that point. I don't think that's what's going on here because the demand/available ratio is so low, but I don't know anything about your apps, either. If you think that this is the problem, you can raise the VM's startup value and let Hyper-V pressure it down if it wants.

    0 comments No comments

  2. Brian Illner 1 Reputation point
    2022-05-13T12:54:53.247+00:00

    Or something is broken (and undocumented) as other admins are recommending not to use dynamic memory with Server 2019 VMs

    event-id-1069-restarted-vms.html

    0 comments No comments