Table of Contents

Class MemoryPool

Namespace
ParquetSharp
Assembly
ParquetSharp.dll

Base class for memory allocation on the CPU. Tracks the number of allocated bytes.

public class MemoryPool
Inheritance
MemoryPool
Derived
Inherited Members

Properties

BackendName

The name of the backend used by this memory pool.

public string BackendName { get; }

Property Value

string

BytesAllocated

The number of bytes currently allocated by this memory pool and not yet freed.

public long BytesAllocated { get; }

Property Value

long

MaxMemory

The peak number of bytes allocated by this memory pool.

public long MaxMemory { get; }

Property Value

long

NumAllocations

The number of allocations made by this memory pool, including allocations that have since been freed.

public long NumAllocations { get; }

Property Value

long

TotalBytesAllocated

The total number of bytes allocated by this memory pool, including bytes that have since been freed.

public long TotalBytesAllocated { get; }

Property Value

long

Methods

GetDefaultMemoryPool()

Get the default memory pool for native allocations. This can be configured by setting the "ARROW_DEFAULT_MEMORY_POOL" environment variable. Possible values are "system", "jemalloc", "mimalloc".

public static MemoryPool GetDefaultMemoryPool()

Returns

MemoryPool

The default memory pool instance

JemallocMemoryPool()

Get a memory pool that uses the jemalloc allocator.

public static MemoryPool JemallocMemoryPool()

Returns

MemoryPool

A jemalloc memory pool

Exceptions

ParquetException

Thrown if ParquetSharp was not built with Jemalloc enabled.

MimallocMemoryPool()

Get a memory pool that uses the mimalloc allocator.

public static MemoryPool MimallocMemoryPool()

Returns

MemoryPool

A mimalloc memory pool

Exceptions

ParquetException

Thrown if ParquetSharp was not built with Mimalloc enabled.

ReleaseUnused()

Attempt to return unused memory held by the underlying allocator to the operating system.

public void ReleaseUnused()

Remarks

This only applies to allocators that hold on to freed memory for reuse, and is best effort: a memory pool may not implement it or may be unable to release memory due to fragmentation. Depending on the backend this may be relatively expensive, so it is intended to be called at points where memory usage is expected to have dropped, such as after closing a buffered row group or disposing a file writer.

SystemMemoryPool()

Get a memory pool that uses the system allocator.

public static MemoryPool SystemMemoryPool()

Returns

MemoryPool

The system memory pool