Table of Contents

Struct MemoryAllocatorOptions

Namespace
SixLabors.ImageSharp.Memory
Assembly
SixLabors.ImageSharp.dll

Defines options for creating the default MemoryAllocator.

public struct MemoryAllocatorOptions
Inherited Members

Properties

AccumulativeAllocationLimitMegabytes

Gets or sets a value defining the maximum accumulative size, in Megabytes, of all active allocations made through the created MemoryAllocator instance. null (the default) imposes no limit on the accumulative total.

public int? AccumulativeAllocationLimitMegabytes { readonly get; set; }

Property Value

int?

AllocationLimitMegabytes

Gets or sets a value defining the maximum (discontiguous) buffer size that can be allocated by the allocator in Megabytes. null means platform default: 1GB on 32-bit processes, 4GB on 64-bit processes.

public int? AllocationLimitMegabytes { readonly get; set; }

Property Value

int?

MaximumPoolSizeMegabytes

Gets or sets a value defining the maximum size of the MemoryAllocator's internal memory pool in Megabytes. null means platform default.

public int? MaximumPoolSizeMegabytes { readonly get; set; }

Property Value

int?

SingleBufferAllocationLimitMegabytes

Gets or sets a value defining the maximum size, in Megabytes, of a single contiguous buffer that the created MemoryAllocator can allocate. null means the default of 1 GB.

public int? SingleBufferAllocationLimitMegabytes { readonly get; set; }

Property Value

int?

Remarks

This limit applies to contiguous buffers, including image buffers requested through PreferContiguousImageBuffers. A single contiguous buffer can never exceed MaxValue bytes, so the largest accepted value is 2047. The applied limit is also capped to AllocationLimitMegabytes because a single buffer can never be larger than the total allocation limit.