Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1011

Commented Unassigned: Insufficient memory (case 4) [1421]

$
0
0
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: You got it! Thanks to my code changes to use temp files i happened to watch the temp folder while the process was running to make sure it wasn't orphaning any temporary jpg files. By the good graces of god guess what else i noticed sitting in the temp folder? I noticed that magic.net had unpacked the 32 bit DLL and not the 64 bit one. So... the windows service was running in 32-bit and capped at 2 gigs. I guess the .Write() calls are the most expensive and suffered from this limit. Was caused by a default build option being checked to "Prefer 32 bit" on the service's CSProj properties. I've now removed the temp files and the locking and am testing how many more files i can process at once without getting memory errors. In a round about way your suggestion to use files instead of streams led to this getting figured out and it's appreciated!

Viewing all articles
Browse latest Browse all 1011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>