Bug 26650 - [Android] Out of Memory error when repeatedly moving back and forth between main page and grid of images in StackLayout
Summary: [Android] Out of Memory error when repeatedly moving back and forth between m...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: 1.3.5
Assignee: Bugzilla
Depends on:
Reported: 2015-02-02 14:30 UTC by Dominic N [MSFT]
Modified: 2015-02-18 09:00 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Test project demonstrating issue (692.24 KB, application/zip)
2015-02-02 14:30 UTC, Dominic N [MSFT]

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 Dominic N [MSFT] 2015-02-02 14:30:20 UTC
Created attachment 9604 [details]
Test project demonstrating issue

## Overview

There is a report of an issue with Android Xamarin.Forms apps where an Out of Memory exception is thrown when navigating back and forth between a main page and a grid of images laid out in a StackLayout. A sample Forms app is provided. It contains two images approximately 500 x 500 in a grid on a StackLayout and a button on the main page that allows you to get to the images. Navigating to and from the image page eventually throws the aforementioned error.

The customer reports that the issue consistently appears on the LG G2 and not on his Motorola Razr Maxx. I've managed to reproduce using a Nexus 4 emulator.

## Steps to reproduce

1. Deploy app to Android device or emulator
2. Press show minion button
3. Navigate back (using hard-button or soft-button - doesn't matter which)
4. Repeat steps 2. and 3. until an error is thrown

## Expected results

Application allows user to move back and forth between main screen and screen with images as many times as necessary.

## Actual results

After navigating back and forth a number of times (observed to be between 10 and 25 times on a Nexus 4 in my tests), the application throws an Out of Memory exception.

## Additional information

This has been tested on Xamarin.Forms 1.3.2-pre3 as well as 1.3.1 and the issue still remains.
Comment 2 Jason Smith [MSFT] 2015-02-11 11:29:02 UTC
Should be fixed in 1.3.5-pre1
Comment 3 Rajneesh Kumar 2015-02-18 09:00:30 UTC
I have checked this issue with the following builds:

Xamarin.Forms Version:
Xamarin Studio Version 5.7.1 (build 17)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Mono 3.12.0 ((detached/de2f33f)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000076
Xamarin.Android Version: (Business Edition)
Xamarin.iOS Version: (Business Edition)
===Build Information ===
Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0
=== Operating System ===
Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014
root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

I have checked this issue with Xamarin.forms Version: on emulator and device(Nexus 4) both and I navigate back and forth more then 100 times and observed that its working fine. Now application allows user to move back and forth between main screen and screen without any error or exception. Please refer the screencast below:

Screencast(Emulator): http://www.screencast.com/t/EmVTMUzjfxL
Screencast(Device): http://www.screencast.com/t/ZQaSgbSqr

Note: I was also able to reproduce this issue before updating Xamarin.forms to
So now this issue has been fixed Xamarin.forms Version:, and its working fine hence I am closing this issue.