<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtualMachineConfiguration/memorySize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZVirtualMachineConfiguration(py)memorySize"
  },
  "title" : "memorySize"
}
-->

# memorySize

The amount of physical memory the guest operating system recognizes.

```
var memorySize: UInt64 { get set }
```

## Discussion

The value in this property represents the *physical memory* available to the guest operating system. This physical memory doesn’t necessarily map to the physical memory of the host computer. Instead, it’s a contiguous block of virtual memory that the host system reserves, but doesn’t allocate immediately, for the guest system. The guest operating system treats this memory as its physical memory and allocates pages from it as needed.

The value of this property must be a multiple of 1 MB. The value must also be greater than or equal to the value in [`minimumAllowedMemorySize`](/documentation/Virtualization/VZVirtualMachineConfiguration/minimumAllowedMemorySize), and less than or equal to the value in [`maximumAllowedMemorySize`](/documentation/Virtualization/VZVirtualMachineConfiguration/maximumAllowedMemorySize).

The guest system’s physical memory size doesn’t change unless you use a memory balloon device to change it. For more information, see the [`memoryBalloonDevices`](/documentation/Virtualization/VZVirtualMachineConfiguration/memoryBalloonDevices) property.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)