I have a Hyper-V 2012 R2 server running a number of virtual machines with Dynamic Memory enabled. They all exhibit this behaviour, but here is an example:
One of the VM's is a Windows Server 2012 R2 guest, and it's not doing much. Basically sitting there idling. It was doing a lot of work (it had launched a number of processes which allocated a bunch of memory, used some CPU, and then quit), but has now completed.
Task manager inside the VM shows the following memory statistics:
- In Use: 5.5 GB
- Available: 302 MB
- Committed: 5.6/6.9 GB
- Cached: 299 MB
The "Memory Composition" graph says that 5629 MB is "In Use" by applications, drivers, etc (i.e. it's not being used as file system cache). I've also run perfmon and the counters there line up with the task manager ones.
Switching to the list of processes in task manager inside the VM, there is nothing using anything close to 5 GB of memory. Summing them all up comes to well under 1 GB.
For more information, Hyper-V manager on the host system shows that this VM has
- Assigned Memory: 706 MB
- Memory Demand: 593 MB
This fits with the memory usage I get by summing up the process list in task manager in the VM.
So the question is:
Why does task manager inside my VM think that it is using 5.5 GB, when no processes appear to use this memory, and the Hyper-V host knows that it only needs 593 MB? What has happened?