Bug 25052 - Garbage Collector does not remove ContentPages within MasterDetailPage when setting ItemSource and ItemTemplate
Summary: Garbage Collector does not remove ContentPages within MasterDetailPage when s...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2014-12-03 15:26 UTC by Kent Green [MSFT]
Modified: 2017-08-29 03:27 UTC (History)
9 users (show)

Tags: ac, garbage, memory, ContentPage, navigation
Is this bug a regression?: ---
Last known good build:


Attachments
Logs from Xamarin Studio (116.51 KB, application/zip)
2014-12-03 15:26 UTC, Kent Green [MSFT]
Details


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 25052 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:
Status:
CONFIRMED

Description Kent Green [MSFT] 2014-12-03 15:26:27 UTC
Created attachment 8955 [details]
Logs from Xamarin Studio

---Overview---
From this desk case:
https://xamarin.desk.com/agent/case/107575

Customer reported that ContentPages are not collected when setting ItemSource & ItemTemplate. I was able to reproduce this issue in the customer provided sample and confirmed that commenting out either ItemSource OR ItemTemplate stopped the occurrence of the bug; it appears to be fully contingent on both being present at the same time.

Since the sample was submitted by a customer, I will add it shortly as a private attachment.

---Steps to reproduce---
1. Run the sample.
2. Click on "Master" to open the MasterDetail page.
3. Click "Open counting page" to open the ContentPage.
4. Watch the Application Output window, & the log counts the page Instances. 

I was able to repo the bug in both the Xamarin Android Player & the iOS simulator. 

---Expected Behavior---
Each time the "Open counting page" button is clicked, the Instance should be Constructed, and then Destructed; so that the count alternates between 1 & 2 instances. This is the behavior that is seen if either ItemSource AND/OR ItemTemplate is commented out.

---Actual Behavior---
The instances continue to rise every time "Open counting page" is clicked while ItemSource AND ItemTemplate are present.

---Build Information---
Xamarin.Forms v. 1.2.3

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	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: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.iOS ===

Version: 8.4.0.43 (Business Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.10.1
Darwin Kents-MacBook-Pro-2.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

---Additional Notes---
Adding customer sample to repo as a private attachment shortly.
Comment 2 Rodja Trappe 2014-12-04 00:28:03 UTC
The example code is also available on a branch in a public GitHub repository: https://github.com/perpetual-mobile/FormsMenuIcon/tree/countingInstances
Comment 3 narayanp 2014-12-05 07:53:27 UTC
I have tried to reproduce this issue and getting the same behavior. The instances continue to rise every time "Open counting page" is clicked while ItemSource AND ItemTemplate are present. We are getting this issue in both iOS  and Android project.

Screencast: http://www.screencast.com/t/6HotPGaeE22i
IDE log: https://gist.github.com/sunil360/90cb2244d1af1749b029
Application Output: https://gist.github.com/sunil360/b783df3a174a46822fb7

Environment Info:

Xamarin.Forms v 1.2.3

=== Xamarin Studio ===

Version 5.7 (build 638)
Installation UUID: 561c7a69-0a91-4bae-ad7c-f0c79d594337
Runtime:
	Mono 3.12.0 ((detached/18666b6)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000063

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 8.6.0.20 (Trial Edition)
Hash: 7a8a925
Branch: 
Build date: 2014-12-05 00:03:40-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/tajinder/Desktop/android-sdk-macosx
	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)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.Mac ===

Version: 1.11.1.201 (Starter Edition)

=== Build Information ===

Release ID: 507000638
Git revision: ba3aba6a07ade8d9910bb1255b43133436d8c26a
Build date: 2014-12-04 21:01:04-05
Xamarin addins: 87455a60c397ca174b94521a12cee7b9673bbbd1

=== Operating System ===

Mac OS X 10.8.4
Darwin Tajinders-iMac.local 12.4.2 Darwin Kernel Version 12.4.2
    Mon Jun 17 18:00:12 PDT 2013
    root:xnu-2050.45.8~1/RELEASE_X86_64 x86_64
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2014-12-11 00:27:15 UTC
Just for bookkeeping: bug 25257 might be closely related, or maybe even a duplicate.
Comment 5 Falko Schindler 2015-03-13 09:32:47 UTC
With Xamarin.Forms 1.4.0 the bug seems to be resolved. The instance count is not increasing: https://github.com/perpetual-mobile/FormsMenuIcon/tree/countingInstances