<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLAllocation",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLAllocation"
  },
  "title" : "MTLAllocation"
}
-->

# MTLAllocation

A memory allocation from a Metal GPU device, such as a memory heap, texture, or data buffer.

```
protocol MTLAllocation : NSObjectProtocol
```

## Overview

Types that conform to [`MTLAllocation`](/documentation/Metal/MTLAllocation), including [`MTLBuffer`](/documentation/Metal/MTLBuffer), [`MTLTexture`](/documentation/Metal/MTLTexture), and [`MTLHeap`](/documentation/Metal/MTLHeap), have underlying memory. You make their memory *resident*, or GPU-accessible, by adding an allocation to an [`MTLResidencySet`](/documentation/Metal/MTLResidencySet) or calling the appropriate method of a command encoder.

See [Simplifying GPU resource management with residency sets](/documentation/Metal/simplifying-gpu-resource-management-with-residency-sets) for more information.

## Topics

### Inspecting an allocation

[`allocatedSize`](/documentation/Metal/MTLAllocation/allocatedSize)

The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.



---

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)