Table of Contents

Class AdvancedMemoryPool<T>

Namespace
Orleans.GpuBridge.Runtime
Assembly
Orleans.GpuBridge.Runtime.dll

Advanced memory pool with allocation tracking and statistics

public sealed class AdvancedMemoryPool<T> : IGpuMemoryPool<T>, IDisposable where T : unmanaged

Type Parameters

T
Inheritance
AdvancedMemoryPool<T>
Implements
Inherited Members

Constructors

AdvancedMemoryPool(ILogger<AdvancedMemoryPool<T>>, int, int)

Initializes a new instance of the AdvancedMemoryPool<T> class

public AdvancedMemoryPool(ILogger<AdvancedMemoryPool<T>> logger, int maxBufferSize = 16777216, int maxPooledBuffers = 100)

Parameters

logger ILogger<AdvancedMemoryPool<T>>

Logger instance for diagnostics

maxBufferSize int

Maximum size of buffers in the pool (default: 16MB)

maxPooledBuffers int

Maximum number of buffers to maintain in the pool (default: 100)

Methods

Dispose()

Disposes the memory pool and releases all resources

public void Dispose()

GetStats()

Gets current statistics about the memory pool

public MemoryPoolStats GetStats()

Returns

MemoryPoolStats

Memory pool statistics including allocation and usage information

Rent(int)

Rents a memory segment from the pool with at least the specified size

public IGpuMemory<T> Rent(int minSize)

Parameters

minSize int

Minimum size of the memory segment in elements

Returns

IGpuMemory<T>

A pooled GPU memory instance

Return(IGpuMemory<T>)

Returns a memory segment to the pool for reuse

public void Return(IGpuMemory<T> memory)

Parameters

memory IGpuMemory<T>

The memory instance to return