none
Cannot Allocate wanted amount of RAM to hyper-V machine, although host has more than enough free memory RRS feed

  • Question

  • Hi!

    I recently bought a dedicated server, and i wanted to try the windows server 2016 edition ( evaulation version ).

    To be short, my host server has 8GB of RAM, it is using about 1.3GB when idle, and when i try to allocate 5500MB to Hyper-V machine it just throws the classic error "Not Enough Memory in the system to start the virtual machine". 

    I tried messing with the settings a little bit, suck as NUMA spanning, and dynamic memory ( it starts the hyper-v with dynamic memory, but it doesn't want to allocate more than 4.6GB RAM for hyper-V machine when it demands over that, while the host server still has more than 1.5GB RAM free )

    In the end nothing worked.

    One thing I was able to notify, is that, while the RAM on the host is free, some amount of RAM is cached ( tehnically that is free RAM, it clears up if needed), and here is the catch. I can not allocate RAM for Hyper-V machine if it is supposed to free up that cached RAM.

    So here is an example, if 1.5GB RAM on host machine is cached. and host server uses 1.5GB on idle, that means that of totally 8GB, only 5GB remains. And what i am able to achieve, is to allocate only up to that "totally free" 5GB.


    Although this is just a hypothesis, but i tested it and it is really weird how the limit is always that cache size.
    But maybe I am wrong...

    I would be extremely happy if someone has a clue or knows how to deal with this problem, as I am getting desperate.

    Thanks :)
    Tuesday, March 27, 2018 2:16 PM

All replies

  • Hi,

    As I understand it, the issue you are experiencing is: Cannot allocate wanted memory to vm. 
    If I have misunderstood your concern, please don't hesitate to let me know.
    For a Hyper-V host, some memory are reserved to ensure host could run.
    To get the amount of available memory for VMs, we could use the following performance counter:

    Open Performance monitor and add the following counter:

       


    Change to report view:

    Then we can see the available memory for VMs:


    Best Regards,
    Frank

       

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, March 28, 2018 5:30 AM
    Moderator
  • In addition to what Frank shows, you also have to remember that what you see as free memory when nothing is running on the system will vary from what is available once Hyper-V starts a VM.  Hyper-V sets aside 'VM management memory' for every VM that is launched.  The amount of space set aside varies from VM to VM as it is dependent up the actual configuration of the VM.  So it is a bit of a Catch-22.  You see the available memory before launching, so you configure a VM accordingly.  Then you launch and find that there is not enough memory because of the allocation that occurs by the launch of the VM.  Generally speaking, I always allow for a minimum of 2GB for the host if all that is running is Hyper-V.  If it is running other things, even the Hyper-V Manager Console, I will bump the number.  

    tim

    Wednesday, March 28, 2018 1:04 PM
  • So here is the data i got with this ( i can't post pictures yet )

    Hyper-V available memory: 2,607.000

    Task manager-

    In use: 4.1GB (0 compressed)
    Committed: 4.8/9.1 GB
    Paged pool: 232MB
    Available: 3.7GB
    Cached: 3.8GB
    Non-Paged pool: 83.3MB


    currently there is running minecraft game server, so it is taking about 2GB additional RAM, but still, why is this not even close to the free Host memory?

    My regards.

    Wednesday, March 28, 2018 7:52 PM
  • Yea, but when system is idle, as i said it uses 1.3GB RAM. I have 8GB total, and i can't even allocate 5120MB to VM. If my math is right that should be total 6.3 GB which is waaay down below my 8GB. So it really does not make any sense that it would set aside su much RAM only for managment. And when i get to allocate about the max of 4.6GB, the host is using exact 6.6GB and it wont go over that no matter what ( even if the VM demands more memory on Dynamic RAM configuration ).

    The math here says the managment RAM here is already in use, because 1.3GB + that 4.6GB is 5.9GB, and if system is on 6.6GB, that would mean the managment RAM is about 700MB. 
    So i don't see the why is it such a problem to allocate more to VM...

    Wednesday, March 28, 2018 8:00 PM
  • Hi,

    Apart form the memory used by management OS, there is also some memory reserved by Hyper-V host.

    The memory show in performance monitor is the only way to know the correct available memory for VMs. Doing math in task manager is not accurate.

    The following link contains the approximation of the reserve memory:

    http://www.aidanfinn.com/?p=19043

    (3<sup>rd</sup> party link, just for your reference)

    >>Yea, but when system is idle, as i said it uses 1.3GB RAM. I have 8GB total, and i can't even allocate 5120MB to VM.

    In this situation, how about the available memory showing in performance monitor?

    The following KB describes the similar situation:

    https://support.microsoft.com/en-us/help/2962295/virtual-machine-that-s-running-on-windows-server-2012-r2-doesn-t-start

    Best Regards,
    Frank


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, March 29, 2018 2:44 AM
    Moderator
  • "currently there is running minecraft game server,"

    This statement conflicts with what you stated at the beginning - "recently bought a dedicated server".  As soon as you put something else onto the server besides Hyper-V, your raw memory calculations are going to be different.

    As Frank said, use the performance counter numbers instead of Task Manager for getting specific memory utilization.  It is not recommended to run any other service on a Hyper-V host.


    tim

    Thursday, March 29, 2018 12:16 PM
  • Hi,
    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

    Best Regards,

    Frank

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, April 2, 2018 2:06 AM
    Moderator
  • Hi,

    Was your issue resolved? 

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.


    Best Regards,
    Frank

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, April 6, 2018 6:05 AM
    Moderator
  • This thread does not really add up and certainly fails to address the core issue here. 

    In my instance, checking Hyper-V Dynamic Memory balancer with Performance monitor, I have 79GB of memory available, however I am unable to allocate more than 8GB of RAM for hyper-v. A week ago, we had 48GB allocated for one of our VMS, and now I have had to shut down another server running 8GB of RAM just to have one VM up using 8GB of RAM. Updated drivers, bios, checked event logs.. verified nothing has changed on the system and there are no malware issues --- however nothing I am finding on technet seems to address this although there are multiple threads. Please shed some light on this!

    I am running server 2016 fwiw.. 

    Thanks.

    Friday, October 4, 2019 6:15 PM
  • I ran into out of memory issue & found this among many posts when I have plenty & finally figured it out..  If you have ANY VM's setup to use dynamic memory, hyper-v will consume all memory eventually.  I suspected this was the case since stopping & restarting VM's or restarting would free the memory but since I had the dynamic settings at 1024 MB min / 2048 MB max, 20% buffer, default (middle) weight, on just 1 of the VM's it did not occur to me that all 32GB of ram would eventually get consumed. This memory shows as "Driver Locked" in RamMap. 30GB of 32GB with the above settings.  If I created a new VM with even 512MB ram it would not start saying I didn't have enough memory.  Using MemAlloc I was able to free up just over 1GB but the rest of the missing ram was not available without stopping the other VM or restarting then I had 30GB free again. 

    The eventual "fix" was to TURN OFF DYNAMIC MEMORY!   Then whatever is specified for ram is what's used & there's PLENTY of free memory for other things. Not sure if that's a bug/leak in dynamic or by-design, but as it stands dynamic option seems hardly useful.

    I realize it's not exactly the same thing but perhaps a related dynamic allocation/use issue?

    • Edited by Bill48105 Tuesday, October 15, 2019 1:20 PM Clarification
    Tuesday, October 15, 2019 1:07 PM
  • This thread does not really add up and certainly fails to address the core issue here. 

    In my instance, checking Hyper-V Dynamic Memory balancer with Performance monitor, I have 79GB of memory available, however I am unable to allocate more than 8GB of RAM for hyper-v. A week ago, we had 48GB allocated for one of our VMS, and now I have had to shut down another server running 8GB of RAM just to have one VM up using 8GB of RAM. Updated drivers, bios, checked event logs.. verified nothing has changed on the system and there are no malware issues --- however nothing I am finding on technet seems to address this although there are multiple threads. Please shed some light on this!

    I am running server 2016 fwiw.. 

    Thanks.

    --- Update -- I found that this issue was due to ADS. Running the registry fix to limit memeory used by advanced database server and a reboot allowed me to reallocate the 48GB I had been using previously. 


    Friday, October 18, 2019 2:11 PM