Bug 34742 - Memory Leak WinPhone ListView
Summary: Memory Leak WinPhone ListView
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-10-09 20:49 UTC by Adam
Modified: 2017-03-11 03:42 UTC (History)
7 users (show)

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


Attachments
Repro (223.69 KB, application/x-zip-compressed)
2015-10-09 20:49 UTC, Adam
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 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:
Status:
RESOLVED NOT_ON_ROADMAP

Description Adam 2015-10-09 20:49:48 UTC
Created attachment 13269 [details]
Repro

Attached is a repro of the issue. I have a empty ListView on the first page (and a memory counter just to track memory usage).

I click on a button to go to the second page and the memory increases slightly, I go back and it increases again but after a few back and forths the memory is stable and not moving up.

However if I now put anything at all in the ViewCell and I go back and forth between the 2 pages the memory continues to rise forever. The memory jumps when the first page is shown again, almost like it is rebuilding the ListView to display again but then never releasing the original ListView it built.
Comment 1 Adam 2015-10-09 23:51:12 UTC
With some further testing I found out that I can stop the memory leak if I set the ItemsSource on OnAppearing and set it to null OnDisappearing

        protected override void OnAppearing()
        {
            base.OnAppearing();
            TestList.ItemsSource = new List<String>() { "Test", "Test" };
        }

        protected override void OnDisappearing()
        {
            base.OnDisappearing();
            TestList.ItemsSource = null;
        }
Comment 2 Parmendra Kumar 2015-10-12 09:11:14 UTC
I have tried to reproduce this issue and able to reproduce it. To reproduce this issue I have followed attached sample project.

Screencast: http://www.screencast.com/t/WGkGo2Nor

DebugLog: https://gist.github.com/Parmendrak/c296c7ad6ae93ab8c463
IDELog: https://gist.github.com/Parmendrak/236f785834368ff52f30

Environment info:

Xamarin.Forms: 1.5.1-pre1

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.6.00081

Installed Version: Professional

Xamarin   4.0.0.1571 (22caadd)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.11 (f94dc5b)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.2.0.85 (7bcf0da)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 4 Adam 2017-03-11 03:42:56 UTC
Considering WinPhone is sunsetting and this report is about 1.5yrs old, I don't expect this to ever be resolved. I also no longer use WinPhone.

Marking as Resolved and Not On Roadmap