From 56fc139b06182d92fc6b01998daca88e46cb167d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 19 Feb 2026 15:07:00 +1000 Subject: [PATCH] Don't have an affective default limit. --- src/ImageSharp/Memory/Allocators/MemoryAllocator.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/Memory/Allocators/MemoryAllocator.cs b/src/ImageSharp/Memory/Allocators/MemoryAllocator.cs index 2a414f869f..d6badf9282 100644 --- a/src/ImageSharp/Memory/Allocators/MemoryAllocator.cs +++ b/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. /// /// - /// The allocation limit is determined based on the process architecture. For 64-bit processes, - /// the limit is higher than for 32-bit processes. + /// Defaults to , effectively imposing no limit on total allocations. + /// 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.
+ /// When the cumulative size of active allocations exceeds this limit, an will be thrown to + /// prevent further allocations and signal that the limit has been breached. ///
- internal long AccumulativeAllocationLimitBytes { get; private protected set; } = Environment.Is64BitProcess ? 8L * OneGigabyte : 2L * OneGigabyte; + internal long AccumulativeAllocationLimitBytes { get; private protected set; } = long.MaxValue; /// /// Gets the maximum size, in bytes, that can be allocated for a single buffer.