C# Class GSF.IO.Unmanaged.MemoryPoolPageList

Maintains a list of all of the memory allocations for the buffer pool.
This class is not thread safe.
Inheritance: IDisposable
Afficher le fichier Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Méthodes publiques

Свойство Type Description
MemoryPoolCeiling long
PageSize int

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

Dispose() public méthode

Disposes of all of the memory on the list.
public Dispose ( ) : void
Résultat void

GrowMemoryPool() public méthode

Grows the buffer pool to have the desired size
public GrowMemoryPool ( long size ) : bool
size long
Résultat bool

MemoryPoolPageList() public méthode

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
Résultat System

ReleasePage() public méthode

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
Résultat void

SetMaximumPoolSize() public méthode

Changes the allowable buffer size
public SetMaximumPoolSize ( long value ) : long
value long the number of bytes to set.
Résultat long

ShrinkMemoryPool() public méthode

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
Résultat long

TryGetNextPage() public méthode

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
Résultat bool

Property Details

MemoryPoolCeiling public_oe property

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
Résultat long

PageSize public_oe property

Each page will be exactly this size (Based on RAM)
public int PageSize
Résultat int