Exception thrown No space for output buffer

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Keith.Vinson
Posts: 22
Joined: 2017-08-30T12:59:12-07:00
Authentication code: 1151

Re: Exception thrown No space for output buffer

Post by Keith.Vinson »

OK, Here's what I have found. I wouldn't say this is so much a fix for my problem, but it is a workaround. Right before creating a new MagicImage instance of one of the large TIFF images I add the following lines of code:
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GC.Collect ();

While doing this seemed to have "fixed" my problem in reality it has just postponed the day of reckoning until someone shows up with even larger TIFFs (the images in question are around 400 MB in size). All my fix has done is to compact the LOH so that the library stands the best chance of not running out of available memory. Compacting the heap does come with a time penalty, but in my case it wasn't too high a price to pay for getting a clean run out of the program.

Thanks everyone for your help...
Post Reply