Skip to content

Commit 56fc139

Browse files
Don't have an affective default limit.
1 parent 9d41486 commit 56fc139

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/ImageSharp/Memory/Allocators/MemoryAllocator.cs

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

4649
/// <summary>
4750
/// Gets the maximum size, in bytes, that can be allocated for a single buffer.

0 commit comments

Comments
 (0)