C# Класс GSF.IO.Unmanaged.MemoryPoolPageList

Maintains a list of all of the memory allocations for the buffer pool.
This class is not thread safe.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
MemoryPoolCeiling long
PageSize int

Открытые методы

Метод Описание
Dispose ( ) : void

Disposes of all of the memory on the list.

GrowMemoryPool ( long size ) : bool

Grows the buffer pool to have the desired size

MemoryPoolPageList ( int pageSize, long maximumBufferSize ) : System

Create a thread safe list of MemoryPool pages.

ReleasePage ( int index ) : void

Releases a block back to the pool so it can be re-allocated.

SetMaximumPoolSize ( long value ) : long

Changes the allowable buffer size

ShrinkMemoryPool ( long size ) : long

Tries to shrink the buffer pool to the provided size

The buffer pool shrinks to a size less than or equal to size.

TryGetNextPage ( int &index, IntPtr &addressPointer ) : bool

Requests a new block from the buffer pool.

Приватные методы

Метод Описание
CalculateMemoryBlockSize ( int pageSize, long totalSystemMemory ) : int

Calculates the desired allocation block size to request from the OS.

The recommended block size is the totalSystemMemory divided by 1000 but must be a multiple of the system allocation size and the page size and cannot be larger than 1GB

CalculateMemoryPoolCeiling ( int memoryBlockSize, long systemTotalPhysicalMemory ) : long

Computes the ceiling of the buffer pool

Описание методов

Dispose() публичный Метод

Disposes of all of the memory on the list.
public Dispose ( ) : void
Результат void

GrowMemoryPool() публичный Метод

Grows the buffer pool to have the desired size
public GrowMemoryPool ( long size ) : bool
size long
Результат bool

MemoryPoolPageList() публичный Метод

Create a thread safe list of MemoryPool pages.
public MemoryPoolPageList ( int pageSize, long maximumBufferSize ) : System
pageSize int The desired page size. Must be between 4KB and 256KB
maximumBufferSize long The desired maximum size of the allocation. Note: could be less if there is not enough system memory. /// A value of -1 will default based on available system memory
Результат System

ReleasePage() публичный Метод

Releases a block back to the pool so it can be re-allocated.
public ReleasePage ( int index ) : void
index int the index identifier of the block
Результат void

SetMaximumPoolSize() публичный Метод

Changes the allowable buffer size
public SetMaximumPoolSize ( long value ) : long
value long the number of bytes to set.
Результат long

ShrinkMemoryPool() публичный Метод

Tries to shrink the buffer pool to the provided size
The buffer pool shrinks to a size less than or equal to size.
public ShrinkMemoryPool ( long size ) : long
size long The size of the buffer pool
Результат long

TryGetNextPage() публичный Метод

Requests a new block from the buffer pool.
Thrown if the list is full
public TryGetNextPage ( int &index, IntPtr &addressPointer ) : bool
index int the index identifier of the block
addressPointer System.IntPtr the address to the start of the block
Результат bool

Описание свойств

MemoryPoolCeiling публичное свойство

The maximum supported number of bytes that can be allocated based on the amount of RAM in the system. This is not user configurable.
public long MemoryPoolCeiling
Результат long

PageSize публичное свойство

Each page will be exactly this size (Based on RAM)
public int PageSize
Результат int