Class ImagingMemorySettings
Typed configuration options for the memory used while processing images.
Inheritance
Namespace: Umbraco.Cms.Core.Configuration.Models
Assembly: Umbraco.Core.dll
Syntax
public class ImagingMemorySettings
Remarks
Image processing decodes the full-resolution source into memory before it is resized, so peak memory scales with the number of images being processed at the same time rather than with the size of the response. On a host with a hard memory limit - a container, most commonly - an unbounded number of concurrent decodes will exhaust the limit and the process will be killed.
Zero means "derive a value from the memory available to the process". What each is derived as, and whether it is applied at all, belongs to the imaging package that reads these - the policy depends on the imaging library's own defaults, which this assembly knows nothing about.
Constructors
View SourceImagingMemorySettings()
Declaration
public ImagingMemorySettings()
Properties
View SourceEnabled
Gets or sets a value indicating whether image processing memory is managed.
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
When enabled, the pool the imaging library retains between requests is capped, the number of
images decoded at the same time is bounded and the size of a single decoded image is capped,
on hosts where the memory available to the process is limited. Defaults to false,
which leaves the imaging library's own memory behavior untouched.
MaximumConcurrentProcessing
Gets or sets the maximum number of images that may be processed at the same time.
Declaration
public int MaximumConcurrentProcessing { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Requests beyond this limit wait for a place. One that does not get a place within the imaging
package's wait timeout is turned away with a 503 Service Unavailable response rather
than queued indefinitely. Set to zero to derive a value from the available memory and
processor count.
MaximumDecodedImageMegabytes
Gets or sets the maximum size, in megabytes, of any single buffer allocated while decoding an image.
Declaration
public int MaximumDecodedImageMegabytes { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
A request for an image needing more than this fails rather than being served, which on a memory-limited host is preferable to exhausting the limit and taking the process with it. MaximumConcurrentProcessing bounds how many images are decoded at once against an assumed cost each; this bounds the largest allocation within one of them.
A decode makes several allocations, so this is not a ceiling on what one image costs in total. It caps the dominant one - the pixel buffer - which is enough to catch a source far larger than the host can serve. Set to zero to derive a value from the available memory.
MaximumPoolSizeMegabytes
Gets or sets the maximum size, in megabytes, of the pool the imaging library retains for reuse between requests.
Declaration
public int MaximumPoolSizeMegabytes { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
This memory is unmanaged, so it is not governed by any of the DOTNET_GC* settings and
does not appear in the managed heap. Set to zero to derive a value from the available memory.