---
title: CMMutableDataBlockBuffer.MemoryPool
framework: coremedia
role: symbol
role_heading: Class
path: coremedia/cmmutabledatablockbuffer/memorypool
---

# CMMutableDataBlockBuffer.MemoryPool

Optimize memory allocations when working with large block buffers.

## Declaration

```swift
final class MemoryPool
```

## Overview

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:)](coremedia/cmmutabledatablockbuffer/memorypool/init(ageoutduration:).md)

### Instance Methods

- [flush()](coremedia/cmmutabledatablockbuffer/memorypool/flush().md)
- [makeBlockBuffer(copying:)](coremedia/cmmutabledatablockbuffer/memorypool/makeblockbuffer(copying:).md)
- [makeBlockBuffer(count:)](coremedia/cmmutabledatablockbuffer/memorypool/makeblockbuffer(count:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
