<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/memory-heaps",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Memory heaps"
}
-->

# Memory heaps

Take control of your app’s GPU memory management by creating a large memory allocation for various buffers, textures, and other resources.

## Discussion

Use an [`MTLHeap`](/documentation/Metal/MTLHeap) to quickly create and destroy GPU resources. Heaps can also help your apps save memory by aliasing portions of it in multiple places.

Create a heap by calling an [`MTLDevice`](/documentation/Metal/MTLDevice) instance’s [`makeHeap(descriptor:)`](/documentation/Metal/MTLDevice/makeHeap(descriptor:)) method.

> Note:
> Metal only synchronizes resources that you create from a Metal heap and that have the ``doc://com.apple.metal/documentation/Metal/MTLHeap/hazardTrackingMode`` property set to ``doc://com.apple.metal/documentation/Metal/MTLHazardTrackingMode/tracked``.

## Topics

### Resource memory allocation and management

[Using argument buffers with resource heaps](/documentation/Metal/using-argument-buffers-with-resource-heaps)

Reduce CPU overhead by using arrays inside argument buffers and combining them with resource heaps.

[Implementing a multistage image filter using heaps and events](/documentation/Metal/implementing-a-multistage-image-filter-using-heaps-and-events)

Use events to synchronize access to resources allocated on a heap.

[Implementing a multistage image filter using heaps and fences](/documentation/Metal/implementing-a-multistage-image-filter-using-heaps-and-fences)

Use fences to synchronize access to resources allocated on a heap.

[`MTLHeap`](/documentation/Metal/MTLHeap)

A memory pool from which you can suballocate resources.

[`MTLHeapDescriptor`](/documentation/Metal/MTLHeapDescriptor)

A configuration that customizes the behavior for a Metal memory heap.

[`MTLHeapType`](/documentation/Metal/MTLHeapType)

The options you use to choose the heap type.

[`MTLSizeAndAlign`](/documentation/Metal/MTLSizeAndAlign)

The size and alignment of a resource, in bytes.



---

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)