Bug 17206 - Android version 4.1.2 garbage collector bug
Summary: Android version 4.1.2 garbage collector bug
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.16.0
Hardware: PC All
: High normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2014-01-13 15:23 UTC by Jon Goldberger [MSFT]
Modified: 2016-04-21 03:13 UTC (History)
3 users (show)

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

Test project (32.70 KB, application/zip)
2014-01-13 15:23 UTC, Jon Goldberger [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 for Bug 17206 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Comment 1 Jon Goldberger [MSFT] 2014-01-13 15:27:53 UTC
I replicated the below issue in Xamarin Studio (Mac) on an emulator running Android 4.1.2. Let the test project run for a few minutes and it will crash. This did not occur testing on an Android 4.2.2 device.

From case: 

"Hello! I have some problems with GC on 4.1.2. Other versions work
correctly. Next code throws global references overflow:

[Activity(Label = "AndroidApplication2", MainLauncher = true, Icon =
public class Activity1 : Activity
protected override void OnCreate(Bundle bundle)

protected override void OnResume()

[Activity(Label = "My Activity")]
public class Activity2 : Activity
protected override void OnCreate(Bundle bundle)

protected override void OnResume()

You can see cycled navigation here. On most devices GC clears references
and application never closed. This code failed on 4.1.2 devices and
emulator. I used Xamarin Android 4.11.00217. How can i fix this bug by
myself? Or do i need to wait more updates from Xamarin?"
*Test Cases*
Problem occurs after 3-5 minutes runtime only on android 4.1.2

Version info:

*Version Information*
=== Xamarin Studio ===

Version 4.2.2 (build 2)
Installation UUID: 155fd51c-ebb1-46d3-a22d-5e604753e016
Microsoft .NET 4.0.30319.34003
GTK+ 2.24.20 theme: MS-Windows
GTK# (

=== Xamarin.Android ===

Version: 4.11.0 (Business Edition)
Android SDK: C:\Users\Andrey\AppData\Local\Android\android-sdk
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode)

=== Build Information ===

Release ID: 402020002
Build date: 2013-11-19 10:28:29Z
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 2 Andrey 2014-05-07 07:55:30 UTC
Hello! Please tell me when will be fixed this bug? It has been almost 4 months. This error occurs in many projects, when I am trying to navigate. This error prevents creating high quality application!
Comment 3 Rodrigo Kumpera 2014-08-04 14:04:06 UTC
Hey Alex,

Could you take a look at this one?
Comment 4 Alex Rønne Petersen 2014-08-04 14:50:08 UTC
Which Android version *does* this happen with? I don't think I have a pre-4.2.2 device...
Comment 5 Atsushi Eno 2014-08-04 19:16:28 UTC
I confirmed with x86 emulator.