4 ms·
The VM is different somehow, as it can dynamically free RAM when the rest of the system needs it, whereas normal Hyper-V VMs capture all of the RAM they ever ne
by easton 6y ago
The VM is different somehow, as it can dynamically free RAM when the rest of the system needs it, whereas normal Hyper-V VMs capture all of the RAM they ever need and never give it back (this was a problem with Docker Desktop, as if I had my browser and Spotify up, it wouldn’t be able to start because it couldn’t reserve enough RAM. Now, since they ship it as a WSL2 distro, it works fine).
A similar strategy is used for Windows Sandbox and Defender Application Guard (which run Windows in a proto VM so applications like web browsers can’t access the rest of the system). Interestingly, graphics acceleration also works completely like native (at least to my fairly untrained eye), without assigning a discrete GPU. I think this also happens in WSL2.
- fulafel 6y agoOn the interwebs it says that Hyper-V is supposed to support memory ballooning (since about Windows Server 2012), just like other virtualization platforms. Maybe the Docker software just didn't use it, or maybe it requires a Windows Server license? edit: seems Docker just chose to disable it because they thought it made memory usage unpredictable: https://github.com/docker/for-win/issues/521 https://github.com/docker/for-win/issues/521
- panpanna 6y agoHasn't this been around since 2.6? http://lxr.linux.no/#linux+v2.6.34.1/drivers/virtio/virtio_balloon.c http://lxr.linux.no/#linux+v2.6.34.1/drivers/virtio/virtio_b...
- easton 6y agoIn KVM, yes, not in Windows. I've never had good luck with Hyper-V's dynamic memory management, unless the OS was already completely installed (Windows' installer would fail unless I dedicated the RAM. I remember it working better with Linux unless you needed to PXE boot).