Bug 25780 - OutOfMemory with Images in WP8
Summary: OutOfMemory with Images in WP8
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Windows
: Normal enhancement
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-01-07 10:41 UTC by Oren Novotny
Modified: 2016-05-28 00:51 UTC (History)
6 users (show)

Tags: windows memory image list view ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Oren Novotny 2015-01-07 10:41:34 UTC
When trying to load an RSS feed into a ListView, I kept hitting OOM exceptions on WP8. Digging deeper, the issue stems from the ImageRenderer not setting an appropriate DecodeImageHeight/DecodeImageWidth on the BitmapImage, so it takes up too much memory.

I worked around it with a custom renderer on Images, but something as basic as this should be the default. Basically, if RequestedHeight/RequestedWidth is specified on the image, it should set the decode values on the BitmapImage.
Comment 1 Oren Novotny 2015-01-07 11:46:55 UTC
I wrote up a renderer that fixes the OOM and properly frees up the contained BitmapSources' memory here:
Comment 2 Oren Novotny 2015-01-13 10:14:51 UTC
I have a full repro here:
Comment 4 Jason Smith [MSFT] 2015-06-11 14:58:50 UTC
We will need to add new API to set the decode size.
Comment 5 Samantha Houts [MSFT] 2016-05-28 00:51:04 UTC
Thank you for taking the time to submit this feature request. We like this idea and have added it to our internal feature tracking system.

Warm regards,
Xamarin Forms Team