<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtioSharedMemoryRegion/unmapMemory(atOffset:size:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZVirtioSharedMemoryRegion(im)unmapMemoryAtOffset:size:completionHandler:"
  },
  "title" : "unmapMemory(atOffset:size:completionHandler:)"
}
-->

# unmapMemory(atOffset:size:completionHandler:)

Unmaps a chunk of host memory from the shared memory region.

```
func unmapMemory(atOffset offset: UInt64, size: UInt64, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```
func unmapMemory(atOffset offset: UInt64, size: UInt64) async throws
```

## Parameters

`offset`

The offset from the start of the shared memory region where the memory should be unmapped.

`size`

The size of the memory to be unmapped from the shared memory region.

`completionHandler`

Block called after memory has been successfully unmapped or on error.
The error parameter passed to the block is `nil` if the unmap operation is successful.
The framework invokes the block on [`deviceQueue`](/documentation/Virtualization/VZCustomVirtioDevice/deviceQueue).

---

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)