RecyclableMemoryStreamManager.Options class

December 6, 2023 · View on GitHub

Parameters for customizing the behavior of RecyclableMemoryStreamManager

public class Options

Public Members

namedescription
Options()Creates a new Options object.
Options(…)Creates a new Options object with the most common options.
AggressiveBufferReturn { get; set; }Whether dirty buffers can be immediately returned to the buffer pool.
BlockSize { get; set; }Gets or sets the size of the pooled blocks. This must be greater than 0.
GenerateCallStacks { get; set; }Whether to save call stacks for stream allocations. This can help in debugging. It should NEVER be turned on generally in production.
LargeBufferMultiple { get; set; }Each large buffer will be a multiple exponential of this value
MaximumBufferSize { get; set; }Buffer beyond this length are not pooled.
MaximumLargePoolFreeBytes { get; set; }Maximum number of bytes to keep available in the large pools.
MaximumSmallPoolFreeBytes { get; set; }Maximum number of bytes to keep available in the small pool.
MaximumStreamCapacity { get; set; }Maximum stream capacity in bytes. Attempts to set a larger capacity will result in an exception.
ThrowExceptionOnToArray { get; set; }Causes an exception to be thrown if ToArray is ever called.
UseExponentialLargeBuffer { get; set; }Whether to use the exponential allocation strategy (see documentation).
ZeroOutBuffer { get; set; }Zero out buffers on allocation and before returning them to the pool.

See Also