WriteableBitmap "out of memory exception" or COMException 88980003

Jul 3, 2015 at 1:47 PM
I am trying to use WriteableBitmapEx filter methods Adjust Brightness/Contrast/Gamma to adjust images in response to Slider control value changes and I am getting the above exceptions. I have tried to force garbage collection and release resources, but have not totally eliminated the exceptions. With my test app I can select the JPG image that I want to manipulate and the issue does seem to be a problem with larger files.

Can someone point me at a working example of how to do this?

Thanks,

Rick Burke
Jul 6, 2015 at 6:10 PM
I am still unable to resolve the issue with memory leaks after calls the Writeablebitmap filter extensions. The leaks may not be in the extensions, but they make the extensions unusable.

As an aside... I was able to make significant performance improvements in every filter by using Parallel.For loops for processing. For example, I was able to reduce the time for a 3x3 Gaussian blur from 2.45 seconds to 0.67 seconds by making this simple change. My platform was a WPF desktop app.

The filter extensions all return a new WriteableBitmap. I will be trying a different approach that updates the Back Buffer of the original bitmap instead. Hopefully this will work around the leaking objects!

In the mean time, if anyone has any guidance I would be interested to hear it. That is if anyone actually reads this note (this project does not seem to be very active!)
Aug 18 at 1:00 PM
Were you ever able to find fixes for the memory stuff?

I believe this is .NET 4.5 and up only, but putting
<runtime>
  <gcAllowVeryLargeObjects enabled="true" />
</runtime>
into your App.config will help depending on what exactly you're doing. Basically on 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size, which may solve certain issues (it did with me but that was because I was using arrays along with WriteableBitmapEx).
Aug 18 at 1:19 PM

No, I was not. I basically gave up on using WriteableBitmapEx class.

Thanks,

Rick


On 8/18/2016 6:00 AM, Scusemua wrote:

From: Scusemua

Were you ever able to find fixes for the memory stuff?

I believe this is .NET 4.5 and up only, but putting
<runtime>
  <gcAllowVeryLargeObjects enabled="true" />
</runtime>
into your App.config will help depending on what exactly you're doing. Basically on 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size, which may solve certain issues (it did with me but that was because I was using arrays along with WriteableBitmapEx).