VBox 7.0.12 running on Sonoma 14.1. Virtual machine is Windows 10 Pro 22H2
I have noticed that VirtualBox allocates twice the memory on the host system as allocated in the virtual one. For example, if I allocate 2GB for the virtual machine, VBOX will take 4GB of real memory from the host (plus about 512MB for vbox itself which is normal) . If I allocate 4GB for the virtual machine, VBOX will take 8.5GB of real memory from the host system, and so on.
I know this was a bug that was fixed in 6.1 release. I've seen this issue on every version of 7.0 since the initial release. Is this a known issue? I tried searching for a open issue list but keep getting a bad gateway error on the site right now.
Thanks in advance for any info.
Virtual machine uses double the allocated ram on the host
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: Virtual machine uses double the allocated ram on the host
Please provide a VM log file. Make sure the VM is fully shut down, then right click it in the manager UI. Select "Show Log" and save "VBox.log" (no other file) to a zip file. Attach the zip here.
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Virtual machine uses double the allocated ram on the host
No, it was never accepted as a bug in VirtualBox (see 19726#comment:35 for the gory details).
In VirtualBox 7.0, there are no kernel extensions any more. In consequence, it looks even more like macOS doubly counts the memory allocated only once by VirtualBox.
Re: Virtual machine uses double the allocated ram on the host
Thank you for the replies. The requested zipped log file is attatched.
Below is the output from 'top' showing 4601MB ram usage for a 2GB windows 10 virtual machine
I did see this behavior in 6.1 but it was resolved in later releases (I unfortunately don't remember the release that fixed it).
Below is the output from 'top' showing 4601MB ram usage for a 2GB windows 10 virtual machine
Code: Select all
PID COMMAND %CPU TIME #TH #WQ #PORT MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT
8300 VirtualBoxVM 46.7 01:27.45 32 2 464 4601M 284K 0B 8300 8299 sleeping *0[8] 0.00000 0.00000 501 1475532+ 1203 9970+-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Virtual machine uses double the allocated ram on the host
The provided memory sums up to: 2.0 GiB + 256.0 MiB = 2048 MiB + 256 MiB = 2304 MiB.Windows 10 BASE-2023-11-01-19-00-17.log wrote:00:00:01.406193 RamSize <integer> = 0x0000000080000000 (2 147 483 648, 2.0 GiB) [...] 00:00:01.406486 VRamSize <integer> = 0x0000000010000000 (268 435 456, 256.0 MiB) [...] 08:36:43.569745 /PGM/Page/cAllPages 591415 count
The allocated memory sums up to: 591,415 * 4 KiB = 2,365,660 KiB = ~2,310 MiB.
Re: Virtual machine uses double the allocated ram on the host
Thanks for that quick analysis! This is a perplexing problem. Unfortunately, I'm not sure how it was resolved under 6.1. It's difficult to think this is an issue on the macos side as I don't see a doubling of RAM usage on applications other than virtualbox. In fact office suite, Firefox, 3rd party open source apps, etc have similar memory foot prints when running natively on windows machines as they do on the mac. In case the logs don't show this, I did not mention that I am using an Intel based Mac if that might make any difference.
If there is any other log or information you may need, please feel free to ask. Thanks again for your time!
If there is any other log or information you may need, please feel free to ask. Thanks again for your time!
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Virtual machine uses double the allocated ram on the host
Well, I don't remember anything that has been done to "resolve" this behavior, which the VirtualBox developers never accepted as a VirtualBox problem. It would be interesting to know what you know.
Type 2 hypervisors like VirtualBox need a special type of memory that is not allowed to be paged out, and which is different from the memory types used by most other applications. For example, on a Windows host, you cannot even see the memory allocated by VirtualBox in the Windows Task Manager (so-called Driver-Locked memory). You could try if another type 2 hypervisor (e.g. VMware Fusion) shows the same behavior.
Re: Virtual machine uses double the allocated ram on the host
Well, as a plain old user and not being as versed in software development as you are, I can only report on my experience that the last few versions of 6.1 did not have this problem on my system (I do remember seeing it way earlier on in 6.1 releases and just dealt with it at the time). Anyway, thanks for your time.
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Virtual machine uses double the allocated ram on the host
Thanks for reporting back, and you're welcome! 