Setting dynamic RAM instead of fixed ram in Virtualbox on Windows 10?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
phattrance
Posts: 20
Joined: 25. Mar 2020, 09:14

Setting dynamic RAM instead of fixed ram in Virtualbox on Windows 10?

Post by phattrance »

Is it possible to choose a setting for RAM so that virtualbox chooses dynamic RAM instead of the fixed RAM? So that virtualbox can choose how much ram it needs instead of me giving it dedicated amount of ram?
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: Setting dynamic RAM instead of fixed ram in Virtualbox on Windows 10?

Post by mpack »

AFAIR no, there is no feature like that. There is a feature called memory ballooning which gives memory pages back to the host if the guest doesn't need them, but that memory is only available to other VirtualBox VMs which also enable memory ballooning. See user manual for details.

Besides, a PC generally uses whatever RAM is available. It doesn't have a concept of how much RAM it needs. Also VirtualBox has no access to the memory allocator inside the guest OS, so VirtualBox doesn't know how full the RAM is. Yes it could (and does, via ballooning) track when memory pages have been written to, but it can't, for example, know when memory has been deallocated.
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: Setting dynamic RAM instead of fixed ram in Virtualbox on Windows 10?

Post by fth0 »

IMHO, it's the other way around:

There is a VirtualBox setting to force the pre-allocation of the RAM before the guest is started, and by default it's not set. So the default is lazy allocation of RAM. But: Some OSs (e.g. from the Microsoft Windows family of OSs) touch all available RAM very early and therefore cancel out the lazy allocation done by VirtualBox.
Post Reply