<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMMutableDataBlockBuffer/MemoryPool",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Media",
      "CoreMedia"
    ],
    "preciseIdentifier" : "s:9CoreMedia24CMMutableDataBlockBufferV10MemoryPoolC"
  },
  "title" : "CMMutableDataBlockBuffer.MemoryPool"
}
-->

# CMMutableDataBlockBuffer.MemoryPool

Optimize memory allocations when working with large block buffers.

```
final class MemoryPool
```

## Overview

This is a memory allocation service that holds a pool of recently deallocated memory. Its purpose is to speed up
subsequent allocations of the same size. You should use a pool in cases where you need to repeatedly allocate large
blocks of memory, such as a video encoding app that outputs compressed data.

This object allocates memory by page. It doesn’t sub-allocate memory within pages, so don’t use it to allocate
small blocks. A pool instance deallocates memory if it isn’t reused in `ageOutDuration`, so that short-term peak
usage doesn’t cause persistent bloat.

## Topics

### Initializers

[`init(ageOutDuration: TimeInterval)`](/documentation/CoreMedia/CMMutableDataBlockBuffer/MemoryPool/init(ageOutDuration:))

### Instance Methods

[`func flush()`](/documentation/CoreMedia/CMMutableDataBlockBuffer/MemoryPool/flush())

Release all memory that the pool was waiting to deallocate.

[`func makeBlockBuffer(copying: UnsafePointer<AudioBufferList>) -> CMMutableDataBlockBuffer`](/documentation/CoreMedia/CMMutableDataBlockBuffer/MemoryPool/makeBlockBuffer(copying:))

Creates a block buffer by copying the given audio buffer list.

[`func makeBlockBuffer(count: Int) -> CMMutableDataBlockBuffer`](/documentation/CoreMedia/CMMutableDataBlockBuffer/MemoryPool/makeBlockBuffer(count:))

Creates a block buffer with `count` number of bytes.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)