Win10 VM ramps up RAM usage until a cirtain point. (driver locked usage)

fpdragon

Member
Feb 24, 2022
85
5
13
40
Hi all,

The problem is that after a fresh boot the Win10 loads and loads more RAM until about 98%. Then the system still runs stable but the VM is wasting huge RAM that I want to share with other VMS by ballooning.

Here is my system:
Proxmox VE 8.1.3
64GB RAM

VM:
Win 10 Enterprise 22H2
VirtIO Guest Tools 0.1.240 from ISO
1704116325581.png
PCIe device is a physical graphics card that I passed through. Had an IO group conflict so I activated this feature that every device has it's own IO group. Maybe this is relevant, since I heard that this is kind of a messy memory mapping?
Additionally 3 USB devices for peripheral.
SWAP is configured automatically by system.

I disabled Win Prefetcher and Superfetcher over registry:
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters]
"EnablePrefetcher"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters]
"EnableSuperfetch"=dword:00000000

And also:
Code:
Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Value "1"

And I disabled NDU via registry:
Code:
Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ndu" -Name "Start" -Value "4"

Task-Manager won't show the processes that are using that much RAM. On the "Performance" tab nearly all the RAM is marked as "in use".
From a fresh reboot it starts with low RAM an steadily ramps up to 98%. This can be seen in Task-Manager and the Proxmox VE "Memory usage" graph
1704116726242.png
This shows the behavior after a reboot.

RamMap tool sais, that the huge mem is consumed by "Mapped File" and "Driver Locked":
1704117517738.png

Poolmon.exe gives the following:
1704117581327.png
So driver with tag "Cont" and "MmSt" are responsible?

That's where I am currently standing.
Any idea what could cause this behavior?
Currently, my best guess is that the PCIe passthrough has an issue but that's just a wild guess and am using this configuration since years.
However I can't say since when this RAM wasting has started.

Hope you can help.
Thanks!
 
Any idea what could cause this behavior?
Maybe this is just ordinary caching. Every file that is read is automatically memory mapped and cached, because you have free ram. This is normal in any OS there is and a good thing. This will continue until you read every file that is needed by your OS and Windowes normally uses a lot of stuff in comparison to a linux.

I want to share with other VMS by ballooning.
Ballooning only kicks in if another VM needs more RAM and askes other VMs if they volunteer memory but in the beginning, the maximum memory you set for ballooning will be allocated and not - as most people think - the minimum.
 
Maybe this is just ordinary caching. Every file that is read is automatically memory mapped and cached, because you have free ram. This is normal in any OS there is and a good thing. This will continue until you read every file that is needed by your OS and Windowes normally uses a lot of stuff in comparison to a linux.


Ballooning only kicks in if another VM needs more RAM and askes other VMs if they volunteer memory but in the beginning, the maximum memory you set for ballooning will be allocated and not - as most people think - the minimum.
Thanks for your answer.

To the first point. I have not seen this behavior that win10 fills up 31GB of RAM right after boot.

To ballooning... Yes that's the behavior I also have seen in a kind. I was not expecting that ballooning already kicks in right after boot, I just wanted to explain why low RAM usage matters for me. However, If 31GB are shown "in use" in win10, I guess Proxmox has no chance to remap this memory to other VMs.
 
Please note that the VM uses PCI(e) passthrough, which requires all VM memory to be pinned into actual host memory because of DMA, and therfore memory ballooning won't work for this VM (and it's therefore useless to set the minimum lower than the maximum).
 
Please note that the VM uses PCI(e) passthrough, which requires all VM memory to be pinned into actual host memory because of DMA, and therfore memory ballooning won't work for this VM (and it's therefore useless to set the minimum lower than the maximum).
Thank you!

So the goal, in having a ballooned RAM for this VM can't be reached.

Just to be sure... Do you know, is this just for the VM that uses PCIe passthrough or does this requirement apply to all VMs on that VE? As you have written I understand that this just applys to the VM with passthrough activated.

The other question is, does this also explain the "in use" behavior of the VM itself or do I have a bad driver with a memory leak?

But your answer brought me one step closer, thanks a lot.
 
Just to be sure... Do you know, is this just for the VM that uses PCIe passthrough or does this requirement apply to all VMs on that VE? As you have written I understand that this just applys to the VM with passthrough activated.
That VM uses PCI(e) passthrough, therefore the memory of that VM needs to be pinned into actual Proxmox host memory. Because the PCI(e) device can do Direct Memory Access (DMA) at any time, all memory (for that VM because the PCI(e) device can only reach that memory) must be ready (and in actual memory). So yes, ballooning won't work for this VM.
The other question is, does this also explain the "in use" behavior of the VM itself or do I have a bad driver with a memory leak?
That depends on whether the balloon driver is loaded inside the VM (even when it does not do ballooning) and the QEMU Guest Agent is installed and working (and enabled in the VM settings). There are very many threads about memory usage displays and discrepencies between them; maybe some of them apply here.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!