|
|
|
@ -42,26 +42,28 @@ namespace SixLabors.Memory |
|
|
|
DefaultNormalPoolBucketCount); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// For environments with limited memory capabilities. Only small images are pooled, which can result in reduced througput.
|
|
|
|
/// For environments with very limited memory capabilities, only small buffers like image rows are pooled.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The memory manager</returns>
|
|
|
|
public static ArrayPoolMemoryAllocator CreateWithModeratePooling() |
|
|
|
public static ArrayPoolMemoryAllocator CreateWithMinimalPooling() |
|
|
|
{ |
|
|
|
return new ArrayPoolMemoryAllocator(1024 * 1024, 32 * 1024, 16, 24); |
|
|
|
return new ArrayPoolMemoryAllocator(64 * 1024, 32 * 1024, 8, 24); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Only pool small buffers like image rows.
|
|
|
|
/// For environments with limited memory capabilities, only small array requests are pooled, which can result in reduced throughput.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The memory manager</returns>
|
|
|
|
public static ArrayPoolMemoryAllocator CreateWithMinimalPooling() |
|
|
|
public static ArrayPoolMemoryAllocator CreateWithModeratePooling() |
|
|
|
{ |
|
|
|
return new ArrayPoolMemoryAllocator(64 * 1024, 32 * 1024, 8, 24); |
|
|
|
return new ArrayPoolMemoryAllocator(1024 * 1024, 32 * 1024, 16, 24); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// RAM is not an issue for me, gimme maximum througput!
|
|
|
|
/// For environments where memory capabilities are not an issue, the maximum amount of array requests are pooled which results in optimal throughput.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The memory manager</returns>
|
|
|
|
public static ArrayPoolMemoryAllocator CreateWithAggressivePooling() |
|
|
|
|