Hi,
Im trying to run magick image in a multiple worker threads but it is occasionally throwing a out of memory exception despite there should be plenty of memory available.
I am using q16 any cpu version 7.0.3.501 and I am trying to do the following on 4096 x 4096 images
I run 4 thread concurently and the used application memory goes between 700mb and 1200mb according to the task manager.
I am setting the ImageMagick.ResourceLimits.Memory = 16009916416 so that should not be the issue (while it is running I have around 7gb of free and available memory according to the task manager).
I also noticed that it saved a lot of image magick files to the temp directory which I was hoping to avoid as 128 mb of diskspace per image is rather much.
Any advice is appriciated
Im trying to run magick image in a multiple worker threads but it is occasionally throwing a out of memory exception despite there should be plenty of memory available.
I am using q16 any cpu version 7.0.3.501 and I am trying to do the following on 4096 x 4096 images
MemoryStream outputStream = new MemoryStream();
try
{
using (ImageMagick.MagickImage img = new ImageMagick.MagickImage(input))
{
img.ColorAlpha(backgroundColor);
img.Format = ImageMagick.MagickFormat.Pjpeg;
img.Quality = quality;
img.Strip();
img.Write(outputStream);
}
}
I know the images are big and that they take up around 128 mb in raw format. I run 4 thread concurently and the used application memory goes between 700mb and 1200mb according to the task manager.
I am setting the ImageMagick.ResourceLimits.Memory = 16009916416 so that should not be the issue (while it is running I have around 7gb of free and available memory according to the task manager).
I also noticed that it saved a lot of image magick files to the temp directory which I was hoping to avoid as 128 mb of diskspace per image is rather much.
Any advice is appriciated