Seeing Hyper-V and Docker memory usage on Windows
This post explains how Hyper-V and Docker reserve memory on Windows machines that is outside of the normal process allocations. It shows how you can see those reservations.
Docker and Hyper-V
Docker Desktop on Windows runs inside a Hyper-V virtual machine. The virtual machine's memory is sized specified on the Memory setting in the Docker Control panel's Advanced tab.Docker Desktop memory reservation. |
That memory sizing maps directly to the Docker virtual machine's Assigned Memory value that is displayed in the Hyper V Manager Virtual Machines view. Hyper-V locks the virtual machine into memory by Drover Locking the VM's memory. Memory used for VMs is partitioned away from the rest of the host's processes.
Hyper-V Manager VM's view |
Memory allocation by type with RamMap
Hyper-V virtual machine memory is allocated on the host and Driver Locked to keep it in memory and prevent usage by other Windows processes. The SysInternals RamMap application displays Windows memory usage by usage type instead of by process. This image shows that 16GB of memory has been Driver Locked. This memory is allocated in the kernel outside of any regular Windows processes.
Window's built in tools show overall memory usage and memory details by process. There can be huge differences between the two because memory may be allocated outside of the normal process boundaries.
Task Manager's Partial View
Task Manager shows that memory is being used. It does not show how it is used
Task Manager shows the total amount of memory in use via the Performance tab. It shows the memory that it is in use. It does not show how the memory is used.
Memory in use on Performance tab |
Task Manager Process tab |
Resource Manager incomplete view
The bottom pane Windows Resource Manager shows a lot of memory in use. The top pane again shows a total usage that when summed is missing the virtual machine.
Resource Manager memory usage |
SysInternals
RamMap is just one of the components of SysInternals. Microsoft provides SysInternals tools free of charge.
Comments
Post a Comment