<!--
{
  "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/MTLResidencySet/allocationCount",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLResidencySet(py)allocationCount"
  },
  "title" : "allocationCount"
}
-->

# allocationCount

The number of resource allocations in the residency set.

```
var allocationCount: Int { get }
```

## Discussion

The value is the number of elements in [`allAllocations`](/documentation/Metal/MTLResidencySet/allAllocations). The residency set updates the property’s value when you call the [`commit()`](/documentation/Metal/MTLResidencySet/commit()) method.

---

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)