One Logo Pool Ball
CoreMedia · IOS API REFERENCE

CMMutableDataBlockBuffer.MemoryPool

class · iOS 26.0+ · SDK 27.1

final class MemoryPool

Optimize memory allocations when working with large block buffers. 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.

Members (2)

init · iOS 26.0+

init

TypeScript
static init(ageOutDuration?: number): CMMutableDataBlockBuffer_MemoryPool
Swift declaration
init(ageOutDuration: TimeInterval = 0.5)
method · iOS 26.0+

flush

TypeScript
flush(): void
Swift declaration
final func flush()

Release all memory that the pool was waiting to deallocate.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

CMMutableDataBlockBuffer.MemoryPool.makeBlockBuffer(count:)

The iOS SDK compiler rejected this binding: instance method 'out' requires that 'CMMutableDataBlockBuffer' be a class type

CMMutableDataBlockBuffer.MemoryPool.makeBlockBuffer(copying:)

The iOS SDK compiler rejected this binding: instance method 'out' requires that 'CMMutableDataBlockBuffer' be a class type

All CoreMedia types →