[Solved] "HostMemoryLow" when enough Host RAM is available

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Computerspezl
Posts: 4
Joined: 9. Dec 2017, 19:17

[Solved] "HostMemoryLow" when enough Host RAM is available

Post by Computerspezl »

Although I have enough free RAM (total RAM: 16 GB, free RAM: 11 GB) on my Windows 10 host, I cannot start any VM with more than 1024 MB RAM for any guest.
The log file shows "HOST RAM: 11045 MB available". The VM is configured to have 4096 MB RAM. But instead of starting, the "HostMemoryLow" error gets thrown and the VM switches to state PAUSED.

The most interesting part of the log file is:
00:00:12.080516 Host RAM: 11045MB available
00:00:12.080520 VM: Raising runtime error 'HostMemoryLow' (fFlags=0x2)
00:00:12.080533 Changing the VM state from 'RUNNING' to 'SUSPENDING'
00:00:12.080626 PDMR3Suspend: after     0 ms, 1 loops: 1 async tasks - ahci/0
00:00:12.625672 AIOMgr: Endpoint for file 'D:\arnob\VirtualBox VMs\CSVM002\CSVM002-disk1.vmdk' (flags 000c0781) created successfully
00:00:13.075681 PDMR3Suspend: 995 124 562 ns run time
00:00:13.075693 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'
00:00:13.075701 Console: Machine state changed to 'Paused'
00:00:13.075828 Console: VM runtime error: fatal=false, errorID=HostMemoryLow message="Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to free up memory or close the VM"
My System:
- VirtualBox: 5.1.30
- Host: Windows 10 Pro Version 1709

Remarks:
I've checked a lot of older posts. But none of those answers - I've tried them all - lead to a solution.

Any hints or solutions are very welcome!
Attachments
VBox.log
Log file with HostMemoryLow error
(118.84 KiB) Downloaded 162 times
Last edited by Computerspezl on 11. Dec 2017, 15:29, edited 2 times in total.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "HostMemoryLow" when enough Host RAM is available

Post by socratis »

A couple of observation/questions:
  1. VirtualBox needs to allocate memory in one contiguous chunk. Failure means that some application has locked itself into the middle of your host RAM, and hence is blocking such large allocations. Solutions would involve finding out what the app is and how to move it in memory, or give less RAM to the VM. It could be an aggressive antivirus, do you have anything other than Windows Defender running?
  2. Do you have Chrome installed on the host? Google's Chrome Crash Handler (GooglecrashHandler.exe or GoogleCrashHandler64.exe) might be responsible for this. Disabling it from running might remedy the situation. Take a look at https://social.technet.microsoft.com/Fo ... -or-system and see if the solution there helps in your case.
  3. Does this happen if you allocate slightly less than 4 GB of RAM, say 3 GB of RAM?
PS. For future reference you should ZIP your logs. It helps save a (virtual) tree or two...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Computerspezl
Posts: 4
Joined: 9. Dec 2017, 19:17

Re: "HostMemoryLow" when enough Host RAM is available

Post by Computerspezl »

socratis wrote:VirtualBox needs to allocate memory in one contiguous chunk. Failure means that some application has locked itself into the middle of your host RAM, and hence is blocking such large allocations. Solutions would involve finding out what the app is and how to move it in memory, or give less RAM to the VM. It could be an aggressive antivirus, do you have anything other than Windows Defender running?
I know about memory chunks. I have verified to have enough "free" memory with RamMap.exe - distributed over a Microsoft site. The host uses only Windows Defender, and I even made my test with Windows Defender deactivated.
Do you have Chrome installed on the host? Google's Chrome Crash Handler (GooglecrashHandler.exe or GoogleCrashHandler64.exe) might be responsible for this. Disabling it from running might remedy the situation. Take a look at urlxxx and see if the solution there helps in your case.
I checked the Google Chrome Crash Handler tip before. It is not running on the host, because I deactivated the option "sending crash reports to Google" in the Chrome browser settings.
Does this happen if you allocate slightly less than 4 GB of RAM, say 3 GB of RAM?[/list]
Yes. When I configure 3 GB or 2 GB, the error occurs as well.

Interestingly, I yesterday succeeded 1 time starting a VM with 4 GB RAM. Early in the start phase, the machine was paused because of the "HostMemoryLow". But I manually switched the "Paused" state, and the machine continued to start without any further error. When the VM run, I could check that it really was using 4 GB RAM.

But in preceding scenarios, I had lots of "HostMemoryLow" errors during the VM's start. At the end, I could not even enter my credentials in the login screen - I think because of not enough ram.

My conclusion so far:
Might it be possible, that there is a certain timeout behavior responsible, that first says: "Not enough memory on host. VM was paused." After manually de-pausing, the VM sometimes runs as it should, sometimes re-stops because of another HostMemoryLow error?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "HostMemoryLow" when enough Host RAM is available

Post by socratis »

Computerspezl wrote:I have verified to have enough "free" memory with RamMap.exe
I didn't talk about free, that was established way before the RAMmap. I talked about "one contiguous chunk" in the kernel (I don't remember exactly which parts require that, but they do).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Computerspezl
Posts: 4
Joined: 9. Dec 2017, 19:17

Re: "HostMemoryLow" when enough Host RAM is available

Post by Computerspezl »

How can I find out the "largest possible one contiguous chunk of ram" in Win 10? The tools I know (resmon.exe, rammap.exe, vmmap.exe) show a large number of values, but not specifically this value.
Computerspezl
Posts: 4
Joined: 9. Dec 2017, 19:17

Re: "HostMemoryLow" when enough Host RAM is available

Post by Computerspezl »

Problem solved! :D

socratis put his finger into the wound. It seems to be a specific Virtualbox requirement, that it can only allocate RAM consisting of one single contiguous chunk of physical memory. It looked like my physical RAM was fragemented into free blocks of max. 1 GB each. (Unfortunately I couldn't evaluate a memory management tool that could visualize my physical memory usage. :( )

To proof my asumption, I used "msconfig.exe" to deactivate all non-Microsoft-services. After a restart, I could successfully start my VM with 2, 4 and even 8 GB of RAM assigned! :D

Next step was to reactivate each single service, reboot my host and restart my VM with 8 G ram. Luckywise, my 1st try identified the "bad" service:

In my case, it was Advantage Database Server, a (legacy) database server from SAP used by one of my line of business Windows applications. I found that it can use lots of memory to implement its own caching system. The following tweak enabled me to switch the ADS cache permanently off:

Add or modify the following DWORD value using the Registry Editor (REGEDIT.EXE):
\\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Advantage\Configuration\MAX_CACHE_MEMORY=x

Now, my VMs with up to 8 GB ram successfully start, although my host is running the Advantage Database Server.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [Solved] "HostMemoryLow" when enough Host RAM is available

Post by socratis »

Great, thanks for the feedback. Glad you got it going. And thanks for marking it as [Solved] !
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
jack4566
Posts: 2
Joined: 7. Jul 2020, 20:42

Re: [Solved] "HostMemoryLow" when enough Host RAM is available

Post by jack4566 »

I had this problem installing ubuntu 20.04 just now on a windows host.

The installation process simply hung, spiking the CPU to 100%. I stopped the VM, and the machine CPU went back to normal.

The new instance i was trying to install was for 8G ram, and I was currently an older ubuntu instance with 8G ram. The windows machine had a total of 16G ram.

I shutdown the old ubuntu instance, re-installed, and it worked fine. Presumably having 2 instances totaling the machine's memory was too much, but really, mem usage should be more dynamic than this.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: [Solved] "HostMemoryLow" when enough Host RAM is available

Post by scottgus1 »

jack4566 wrote:The new instance i was trying to install was for 8G ram, and I was currently [running?] an older ubuntu instance with 8G ram. The windows machine had a total of 16G ram.
This is typical Virtualbox operation:
Running guest 1's RAM + running guest 2's RAM + running guest N's RAM + host's normal usage of RAM <= host installed RAM.

There are some possible tricks, see the manual, section 4.10 https://www.virtualbox.org/manual/ch04. ... mory-usage
Post Reply