Skip to content

Instantly share code, notes, and snippets.

@extremecoders-re
Last active March 13, 2025 05:01
Show Gist options
  • Save extremecoders-re/cf8d829c108d58bfbb2e3c1f4121d7e1 to your computer and use it in GitHub Desktop.
Save extremecoders-re/cf8d829c108d58bfbb2e3c1f4121d7e1 to your computer and use it in GitHub Desktop.
Boost VMWare Performance by disabling vmem files.

Prevent creation of vmmem files in VMware (Windows)

Issue

VMWare creates .vmem files to back the guest RAM. On the host this causes disk thrashing especially during powering on and off the guest.

Solution

Add the following lines to the .vmx file to prevent creation of .vmem files. This will reduce disk IO and VM performance will improve especially on non-SSD disks.

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

References

@slackingfred
Copy link

From my observations, whether .vmem files are disabled does not have an impact on performance (unless you're really short in disk space and need to save several GBs from the .vmem file).
But disabling .vmem file will cause the VM fail to restore from suspended state on occasion. The error I am seeing is "could not create anonymous paging file for <your VM's memory size> MB". When the error occurs, the saved VM state is dropped and data is lost; no chance to retry restoring.
In light of this, I have stopped using the method described in this Gist.

@SyddG
Copy link

SyddG commented Feb 20, 2025

I have a Windows 11 VM guest on a Windows 11 host running VMWare Workstation 17.6.2 and I have been experiencing random crippling HDD spikes on the host HDD that contains the VM. The VM is barely manageable while this is occurring. I ran ProcMon on the host and found the vmware-vmx was constantly reading the VM's vmem file and causing I/O issues on the HDD. On the guest, I see it's using 100% CPU usage across multiple processes but RAM and HDD are nominal. I could have simply moved the VM to one of my SSDs but I didn't want to destroy the SSD with the same constant vmem file reads.

I added the above entries and now the VM is performing much better and not randomly locking up due to vmem-related host HDD I/O issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment