Skip to content

Instantly share code, notes, and snippets.

@extremecoders-re
Last active April 6, 2024 08:09
Show Gist options
  • Star 40 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • 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.

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