Sunday 6 May 2018

memory - Immediately Allocate All RAM to Virtual Machine at Power-On

Is there a setting that I can manually add to a VMWare .vmx file to force it to allocate all of the RAM assigned to a VM immediately when the VM is first powered on?


I know it is usually best to let VMWare allocate RAM to a VM gradually as the VM needs it. But in this case, I really do want/need it to be all allocated up-front.




Background


I have a MacPro with 64GB of RAM, and 24 processors. I use it for virtulization using VMWare Fusion 11. I want one beefy Windows VM (8 processors + 32GB RAM). It takes 8 minutes to boot the VM, with the VM's CPUs all pegged at 100%.


I read on VMWare forums that a VM cannot use the host computer's memory manager for RAM, but must use its CPUs instead. VMWare slowly allocates RAM to the VM during the boot process, and the VM's CPUs peg while it adjusts to more RAM being allocated to it.


The high CPU time during boot is directly proportional to the amount of RAM allocated to the VM:



  • 4GB = 1 minute

  • 8GB = 2 minutes

  • 16GB = 4 minutes

  • 32GB = 8 minutes


I enabled IOMMU in the virtual machine, which maps virtual memory addresses to physical addresses, hoping that would decrease the VM's CPU overhead, but that did not help.


Since Windows has to use CPUs to manage the RAM allocated to the VM, I think it would be more efficient to setup this one VM to pre-allocate all 32GB of RAM, so that all 32GB are immediately allocated all-at-once as soon as it is powered-on, instead of allocating RAM incrementally during the boot.


Once all RAM has been allocated by VMWare to the VM, the CPU activity goes to 0%. If I restart the VM, VMWare knows that the VM will be used immediately again, so it leaves the RAM allocated to the VM, so the restart is very quick (30 seconds with no pegged CPU).




Is there a way to force a VMWare virtual machine to immediately allocate all of the RAM that is assigned to the VM as soon as the virtual machine is powered on?


(Since I'm using Fusion 11, I assume I will need to manually edit the .vmx file...)




Edit #1 With a little help and a bunch of reading, I've tried these settings, but these do not make the host OS allocate all of the RAM to the VM at power-on:


sched.mem.min = "4096"
sched.mem.pin = "TRUE"

sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...