vm.go
func (v *VM) SetMemorySize(size uint) error {
	if size == 0 {
		size = 4
	}

	// Makes sure memory size is divisible by 4, otherwise VMware is going to
	// silently fail, cancelling vix operations.
	if size%4 != 0 {
		size = uint(math.Floor(float64((size / 4) * 4)))
	}

	return v.updateVMX(func(model *vmx.VirtualMachine) error {
		model.Memsize = size
		return nil
	})
}
func (v *VM) SetMemorySize(size uint) error {
	if size == 0 {
		size = 4
	}

	// Makes sure memory size is divisible by 4, otherwise VMware is going to
	// silently fail, cancelling vix operations.
	if size%4 != 0 {
		size = uint(math.Floor(float64((size / 4) * 4)))
	}

	return v.updateVMX(func(model *vmx.VirtualMachine) error {
		model.Memsize = size
		return nil
	})
}
// SetMemorySize sets memory size in megabytes. VM has to be powered off in order to change this parameter.