Immediately Allocate All RAM to Virtual Machine at Power-On

2

1

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"

James L.

Posted 2019-08-30T19:54:55.653

Reputation: 322

Out of curiosity, if you boot to something like memtest and let it run one traversal of one check over the RAM (a few seconds) will it all be allocated to the VM, and that allocation survive a reboot of the VM into Windows? – ivanivan – 2019-08-30T23:23:05.480

I suspect you have misunderstood the cause of the problem, there is no reason for Windows to peg the CPU in response to being allocated more RAM. Can you point at the forum comments you mention? – Harry Johnston – 2019-08-30T23:23:09.223

... it almost sounds as if Windows boot is running a memory test for some reason. What is Windows showing on the virtual display when this is happening? – Harry Johnston – 2019-08-30T23:24:50.010

As Windows 10 boots, it shows the Windows logo, with a spinner beneath it. The CPUs peg when the spinner starts it 2nd loop (spins twice, disappears, spins twice, disappears). Wired memory (in Mac's activity monitor) slowly starts to climb at the same moment. I can eventually log in to Windows with the CPUs still pegged. Win Task Man shows 'System (4) [ntoskrnl]' is using most of the CPU. The CPUs stay pegged as long as the Mac is assigning more RAM to the VM. When that levels off, so does the CPU utilization. – James L. – 2019-08-31T01:53:56.470

Do you have the VMWare drivers etc. installed in Windows? Is there anti-virus software installed that might be causing the problem? – Harry Johnston – 2019-08-31T02:03:18.560

I read dozens of articles and posts on VMWare's site+forum until about 4am last night. I can't find the exact articles... I'll keep looking. – James L. – 2019-08-31T02:04:16.163

VMWare Tools are installed. I removed McAfee, am just using Win10's default now [Windows Defender]. Interestingly, the pegged CPU time doubles each time I double the RAM. – James L. – 2019-08-31T02:05:27.633

No answers