Allocate virtual memory instead of physical memory?

Here you can provide suggestions on how to improve the product, website, etc.
Post Reply
opieant
Posts: 4
Joined: 29. May 2008, 23:31

Allocate virtual memory instead of physical memory?

Post by opieant »

The default behavior of VirtualBox is apparently to allocate RAM for the host in "locked" physical memory. This makes it impossible to allow Windows to make effective use the page file. If I have a guest running with several GB of memory allocated/used at all times but only about 1GB of memory is actively in use at any average moment then the VM is depriving the host of physical memory unnecessarily.

I would be very happy to allow virtual memory to be used and take the performance hit for paging in order to have more physical memory available to the host. Is there any way to configure VirtualBox to behave in this manner?
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: Allocate virtual memory instead of physical memory?

Post by socratis »

opieant wrote:The default behavior of VirtualBox is apparently to allocate RAM for the host in "locked" physical memory.
Not only I think it's what you call the "default", it's the only behavior.
opieant wrote:guest running with several GB of memory allocated/used at all times but only about 1GB of memory is actively in use at any average moment
Don't over allocate resources to your guest that you can't afford. Adjust your settings according to what you expect to be used.
opieant wrote:Is there any way to configure VirtualBox to behave in this manner?
No. See viewtopic.php?f=6&t=88122 for a recent discussion on the subject.
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.
opieant
Posts: 4
Joined: 29. May 2008, 23:31

Re: Allocate virtual memory instead of physical memory?

Post by opieant »

socratis wrote:No. See viewtopic.php?f=6&t=88122 for a recent discussion on the subject.
Thank you for the response. That's very unfortunate. Installing more RAM, reducing RAM usage by processes on the host, and reducing allocation for the guest are not options, so I'll have to explore alternatives.
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: Allocate virtual memory instead of physical memory?

Post by socratis »

If you do find anything during your exploration, let me know, it might be interesting. The only things that VirtualBox can help you with this at the moment is "lazy allocation", "memory ballooning" and "page fusion". See ch. 4.9 Memory overcommitment. These techniques are helpful if you're using more that one, similar VMs only.
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.
opieant
Posts: 4
Joined: 29. May 2008, 23:31

Re: Allocate virtual memory instead of physical memory?

Post by opieant »

socratis wrote:If you do find anything during your exploration, let me know, it might be interesting.
It looks like VMWare has supported this for ages. I switched from VMWare Workstation to VirtualBox about 10 years ago and never took notice of the feature previously.

Image
source: http://trufflepenne.blogspot.com/2012/10/vmware.html

When I have more time I'll have to try migrating the guest to see if the results are acceptable.
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: Allocate virtual memory instead of physical memory?

Post by socratis »

Great! An article in Chinese![1]
According to an online translation:
Sometimes when we use Vmare for a while, we will find that the system seems to be stuck. This may be because some memory is occupied ( refer to this ), and the other is because the memory reserved for the VM is not enough.
That's what VirtualBox is most probably trying to avoid; stuck systems. And systems that when they have expectations to retrieve a page from RAM within a specific time-limit, they don't, and they start misbehaving...

On the other hand, I can't use VMWare, I'm on an OSX host. And Fusion is as far from VMWare as VirtualBox is from VMWare...


[1]: You know how they say "It's all Greek to me"? Well, in Greece they don't use that phrase (obviously), they use "It's all Chinese to me." :)
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.
opieant
Posts: 4
Joined: 29. May 2008, 23:31

Re: Allocate virtual memory instead of physical memory?

Post by opieant »

Sorry, I was just crediting the source of the picture, not the description in that blog. Info about this feature in English is readily available in VMWare documentation.

A .vmem file for the full size of the VM's RAM shows up on the hard drive but is only used as necessary. The "allow most virtual machine memory to be swapped" option corresponds to keeping a minimum of 25% of the VM in physical memory which is basically exactly what I'm looking for. Swapping performance isn't a concern as mentioned before, so unless the guest OS times out doing swap I/O (rather unlikely unless the page file is on a drive that fails) this is a very promising option.
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: Allocate virtual memory instead of physical memory?

Post by socratis »

Moving to "Suggestions" from "Windows Hosts", as your suggestion would cover more than Windows-hosts only...
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.
Post Reply