High RAM usage in Windows 10 VM


Recommended Posts

Hey everyone,

 

I am scratching my head on this one. I stood up a Windows 10 VM with 8 gigs of RAM and it was always at around 7.5 gigs used out of 8. So I increased it to 10, and it's now always at 9.6 out of 10. I really am not doing much on here. So I started digging around and the numbers do not add up for my RAM usage.

 

image.thumb.png.f00fd56119040e2d1043d91848aa7400.png

image.thumb.png.a4e715b61ab147dae6a1471e07a66553.png

 

I saw a post somewhere that the docker containers would be occupying all of that space, but why is it being taken away from my Windows 10 VM? Nor do I have that many containers running:

image.png.c9c0eadbe7d45c3843961ec0fb67b71b.png

 

If I need diagnostics etc.. let me know, but thought I would just ask the question to see if anyone knows the answer without diving into logs.

Link to comment

I can't remember what it's called now, but there is a way of displaying free memory that doesn't really show you the free memory.  i.e it shows up as used, when actually it's cached or something, but still available to use when needed.  So possibly depends on what you used to show the free / used memory?  Unraid GUI or something else?

 

Also, depending on how you assigned the memory to the VM, it's either dedicated or ballooned.  If you assigned the 10G in both fields of your vm config, I believe that's dedicated, what it sounds like you want to do is have shareable memory (like most other vm servers do by default), which means you need to put in a range.  Also, you need to ensure the balloon driver is installed in the guest.

 

Hope that helps.

Link to comment
7 hours ago, johnnie.black said:

Check the VM config and make sure "Initial Memory" and "Max Memory" are set to the same value.

Ahh yes! That did it! Thank you!

 

16 hours ago, Marshalleq said:

I can't remember what it's called now, but there is a way of displaying free memory that doesn't really show you the free memory.  i.e it shows up as used, when actually it's cached or something, but still available to use when needed.  So possibly depends on what you used to show the free / used memory?  Unraid GUI or something else?

 

Also, depending on how you assigned the memory to the VM, it's either dedicated or ballooned.  If you assigned the 10G in both fields of your vm config, I believe that's dedicated, what it sounds like you want to do is have shareable memory (like most other vm servers do by default), which means you need to put in a range.  Also, you need to ensure the balloon driver is installed in the guest.

 

Hope that helps.

Thank you as well for the reply! I don't see a dedicated/ballooned option, but my problem appears fixed. If you have a screen shot of what you are referring to, I'd like to play with this as well!

Link to comment

@LumberJackGeek He is referring to the following VM settings:

 

grafik.png.cfc42ef82a62d366c5f6993d8626acaa.png

 

If you setup both the same value (default) means the VM on startup gets the full amount of assigned RAM. If you setup the initial value lower, the VM will only use that initial amount of RAM and will use up to the max amount if needed. In this case for Unraid there is more RAM available for other use. Be careful not to overprovision all of your VMs.

Edited by bastl
Link to comment
  • 1 year later...

I know this is an old topic but I recently tested Unraid as an alternative to Proxmox which I was considering.

I ran into one issue, the same as the OP describes.

 

With a Windows 10 VM set with min memory 4GB, Max 32GB and the ballooning service installed I would see in the windows task manager memory usage at 94%, that is of the total 32GB, even though Windows was only using about 4GB.

This is basically exactly the same issue and result that the OP LumberJackGeek posted.

 

On the flip side setting min and max to the same value corrects the memory usage reporting in the windows vm task manager but then you are needlessly wasting ram that is not needed at the time by forcefully allocating the full amount to the vm.

 

Under Proxmox I do not have this issue, I have my Windows VM set up from 4GB to 32GB and the task manager reports correct usage so balooning is working there.

 

The only difference I can tell is that there is a QEMU guest agent also installed on the VM and Proxmox is aware of it (via a setting checkbox in Proxmox), maybe that is the missing link with Unraid, I did install the Qemu guest agent on the Win10 VM in Unraid as well as the ballooning service but is there another step that needs to be done in Unraid to finish the setup?

 

Edited by Reytak
grammar, spelling, syntax
Link to comment
  • 1 year later...

Having similar issues on a windows 11 machine.  Have set initial and max memory the same:

3.png.977a0fce68fc99b4b92bca9c33c6ce98.png

 

When I look in the task manager of the virtual machine,  I can see not allot of memory is been used. But it says 69% is already in use:

1.thumb.png.4967c065d9d9abdc61170f3d618cb1cc.png

 

2.thumb.png.db7efebd27fe85aaef5805041093b61b.png

 

When I open a few more things the VM just freezes and becomes unresponsive. While I think it still has allot of memory in spare. What can I do to solve this? 

Link to comment
  • 2 months later...
  • 1 month later...

From the links you posted I wouldn't say it's working as intended, rather it's working the same as it is for everyone else, that is, there is a bug for windows based guests.  Which leads me to wonder about the comparisons to proxmox because it was said that this issue didn't happen there.  Given Proxmox also uses KVM the only remaining options seem to be that they've implemented a workaround or we're mistaken about the difference.  It would be interesting to know if there is a workaround as if that were true, that is something unraid could implement also.

Link to comment
12 hours ago, Marshalleq said:

there is a bug for windows based guests.

It's not a bug, maybe you missed this link?

https://github.com/virtio-win/kvm-guest-drivers-windows/issues/568

 

Initially I was was also having some trouble understanding how this works, let me try to explain, say you set a Windows VM to 4GB minimum and 16GB max, when you boot the VM and the balloon driver loads it will "inflate" with 12GB (16-4), those 12GB will be released and remain available for the host, not for the VM, Windows will report 16GB of total RAM, of those 12GB are in the balloon (and not usable by Windows) and the OS itself will be using about 2GB, so task manager will report 14GB used and 2GB available, that is correct and why you see the high RAM usage, the memory in the balloon can be release to the VM (and at that time it will be removed from the host) manually, as explained here, if you for example now manually set the VM to use 12GB total, only for 4GB will be left in the balloon, so Windows will still report 16GB total, 4GB (remaining in the balloon)+whatever the OS is using as used, and the remaining as available.

 

 

12 hours ago, Marshalleq said:

Given Proxmox also uses KVM

Correct, but Proxmox does custom balloon management, they have a script or similar running in the background that depending on the memory pressure on the host automatically inflates or deflates the balloon, Unraid uses the stock KVM/QEMU memory balloon functionality, which can only be manually adjusted, and basically allows you to add or remove RAM to a running VM, if you'd like to see an automatic balloon control similar to what Proxmox does you can create a feature request, LT can then make it happen or not based on other user interest and if they consider this is a feature worth implementing or not.

  • Upvote 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.