Browse Source

Don't have an affective default limit.

pull/3056/head
James Jackson-South 3 months ago
parent
commit
56fc139b06
  1. 9
      src/ImageSharp/Memory/Allocators/MemoryAllocator.cs

9
src/ImageSharp/Memory/Allocators/MemoryAllocator.cs

@ -38,10 +38,13 @@ public abstract class MemoryAllocator
/// Gets the maximum allowed total allocation size, in bytes, for the current process. /// Gets the maximum allowed total allocation size, in bytes, for the current process.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The allocation limit is determined based on the process architecture. For 64-bit processes, /// Defaults to <see cref="long.MaxValue"/>, effectively imposing no limit on total allocations.
/// the limit is higher than for 32-bit processes. /// This property can be set to enforce a cap on total memory usage across all allocations made through this allocator instance, providing
/// a safeguard against excessive memory consumption.<br/>
/// When the cumulative size of active allocations exceeds this limit, an <see cref="InvalidMemoryOperationException"/> will be thrown to
/// prevent further allocations and signal that the limit has been breached.
/// </remarks> /// </remarks>
internal long AccumulativeAllocationLimitBytes { get; private protected set; } = Environment.Is64BitProcess ? 8L * OneGigabyte : 2L * OneGigabyte; internal long AccumulativeAllocationLimitBytes { get; private protected set; } = long.MaxValue;
/// <summary> /// <summary>
/// Gets the maximum size, in bytes, that can be allocated for a single buffer. /// Gets the maximum size, in bytes, that can be allocated for a single buffer.

Loading…
Cancel
Save