Hi,
I'm using Magick.net in a very high volume multi threaded photo processing application. I see random errors like below. This usually on photos that are larger, I have to deal with JPG files that are sometimes up to 40 megabytes in file size. But, i can see errors like this even on 5 megabyte files. The servers have plenty of memory. Is there anything i can do to avoid this other than forcing the application to only process one photo at a time?
I am using Magick.Net-Q16-AnyCPU version 7.0.3.902
ImageMagick.MagickCorruptImageErrorException\",\"Message\":\"Insufficient memory (case 4)
at ImageMagick.MagickImage.NativeMagickImage.WriteBlob(MagickSettings settings, UIntPtr& length)
at ImageMagick.MagickImage.Write(Stream stream)
Comments: I changed all the .Write() calls i had from Stream based to FileInfo baseed. So from .Write(Stream) to .Write(FileInfo). I then still got out of memory exception in the Write method. I then created a lock object and ensured that only one single Write call could ever execute at a time and i still get out of memory exceptions. There other simultaneous uses of Magic.Net objects going on in parallel at the same time but no other writes. The .Net process is using about 2 gigs of the available 16 gigs on the server and never goes above that.
I'm using Magick.net in a very high volume multi threaded photo processing application. I see random errors like below. This usually on photos that are larger, I have to deal with JPG files that are sometimes up to 40 megabytes in file size. But, i can see errors like this even on 5 megabyte files. The servers have plenty of memory. Is there anything i can do to avoid this other than forcing the application to only process one photo at a time?
I am using Magick.Net-Q16-AnyCPU version 7.0.3.902
ImageMagick.MagickCorruptImageErrorException\",\"Message\":\"Insufficient memory (case 4)
at ImageMagick.MagickImage.NativeMagickImage.WriteBlob(MagickSettings settings, UIntPtr& length)
at ImageMagick.MagickImage.Write(Stream stream)
Comments: I changed all the .Write() calls i had from Stream based to FileInfo baseed. So from .Write(Stream) to .Write(FileInfo). I then still got out of memory exception in the Write method. I then created a lock object and ensured that only one single Write call could ever execute at a time and i still get out of memory exceptions. There other simultaneous uses of Magic.Net objects going on in parallel at the same time but no other writes. The .Net process is using about 2 gigs of the available 16 gigs on the server and never goes above that.