{"action":"closed","issue":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/1352","repository_url":"https://api.github.com/repos/xamarin/Xamarin.Forms","labels_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/1352/comments","events_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/1352/events","html_url":"https://github.com/xamarin/Xamarin.Forms/issues/1352","id":280416091,"number":1352,"title":"[UWP] StackLayouts / NavigationPage leaks memory","user":{"login":"balazsbonis","id":7962460,"avatar_url":"https://avatars3.githubusercontent.com/u/7962460?v=4","gravatar_id":"","url":"https://api.github.com/users/balazsbonis","html_url":"https://github.com/balazsbonis","followers_url":"https://api.github.com/users/balazsbonis/followers","following_url":"https://api.github.com/users/balazsbonis/following{/other_user}","gists_url":"https://api.github.com/users/balazsbonis/gists{/gist_id}","starred_url":"https://api.github.com/users/balazsbonis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balazsbonis/subscriptions","organizations_url":"https://api.github.com/users/balazsbonis/orgs","repos_url":"https://api.github.com/users/balazsbonis/repos","events_url":"https://api.github.com/users/balazsbonis/events{/privacy}","received_events_url":"https://api.github.com/users/balazsbonis/received_events","type":"User","site_admin":false},"labels":[{"id":770580102,"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/p/UWP","name":"p/UWP","color":"a3241d","default":false},{"id":771881931,"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/s/needs-info","name":"s/needs-info","color":"fcb95a","default":false},{"id":343860851,"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/t/bug","name":"t/bug","color":"fc2929","default":false}],"state":"closed","locked":false,"assignee":{"login":"hartez","id":538025,"avatar_url":"https://avatars0.githubusercontent.com/u/538025?v=4","gravatar_id":"","url":"https://api.github.com/users/hartez","html_url":"https://github.com/hartez","followers_url":"https://api.github.com/users/hartez/followers","following_url":"https://api.github.com/users/hartez/following{/other_user}","gists_url":"https://api.github.com/users/hartez/gists{/gist_id}","starred_url":"https://api.github.com/users/hartez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartez/subscriptions","organizations_url":"https://api.github.com/users/hartez/orgs","repos_url":"https://api.github.com/users/hartez/repos","events_url":"https://api.github.com/users/hartez/events{/privacy}","received_events_url":"https://api.github.com/users/hartez/received_events","type":"User","site_admin":false},"assignees":[{"login":"hartez","id":538025,"avatar_url":"https://avatars0.githubusercontent.com/u/538025?v=4","gravatar_id":"","url":"https://api.github.com/users/hartez","html_url":"https://github.com/hartez","followers_url":"https://api.github.com/users/hartez/followers","following_url":"https://api.github.com/users/hartez/following{/other_user}","gists_url":"https://api.github.com/users/hartez/gists{/gist_id}","starred_url":"https://api.github.com/users/hartez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartez/subscriptions","organizations_url":"https://api.github.com/users/hartez/orgs","repos_url":"https://api.github.com/users/hartez/repos","events_url":"https://api.github.com/users/hartez/events{/privacy}","received_events_url":"https://api.github.com/users/hartez/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-12-08T08:48:32Z","updated_at":"2018-04-07T04:34:43Z","closed_at":"2018-04-07T04:34:43Z","author_association":"NONE","body":"### Description\r\nMigrated from https://bugzilla.xamarin.com/show_bug.cgi?id=61027.\r\n\r\nOn UWP with Xamarin.Forms pushing and then popping a page with `StackLayout`s on it to the navigation stack several times will cause the memory consumption grow infinitely.\r\n\r\n### Steps to Reproduce\r\nEither take the sample project attached, or create a simple one with the following setup:\r\n- The main app should have a `NavigationPage` with the main page wrapped inside\r\n- That main page should have a `ListView` of elements\r\n- Clicking on any of those elements should take the user to another page (call it details page), by pushing it to the stack\r\n- Details page should have a back button that will pop the top of the navigation stack and taking it back to the main page\r\n\r\nThis navigation back-and-forth has to be done several times to see the memory usage increase. The problem is that the memory will never be released, `GC` will not collect it, even by forcing from either code or from Visual Studio's performance profiler set to monitor memory usage.\r\n\r\nYou can take a snapshot in the profiler when the app starts and then navigate to a page and then back maybe 20, 30 times. Take another snapshot again, and then let VS analyse the difference. See attached screenshot for the results.\r\n\r\nOver longer periods of time this leads to crashes in every single UWP app with Xamarin.Forms that has this navigation capability.\r\n\r\n### Expected Behavior\r\nGoing back from a page should release the memory used by it, or at least the garbage collector should be able to clean it up at a certain point.\r\n\r\n### Actual Behavior\r\nMemory usage increases indefinitely, eventually crashing the app.\r\n\r\n### Basic Information\r\n\r\n- Version with issue: 2.5.0.121934\r\n- Last known good version: I went back as far as 2.2, none of the versions I've tried worked\r\n- IDE: VS 2017 Community Edition on Windows 10\r\n- Platform Target Frameworks: \r\n  - UWP:  15063\r\n- Nuget Packages: Xamarin.Forms\r\n\r\n### Screenshots\r\nThe issue is not visual, but using visual studio's performance profiler, you can get the following proof of the memory increase:\r\n![image](https://user-images.githubusercontent.com/7962460/33757833-cf2bde72-dbf3-11e7-80d7-95e622baa2f5.png)\r\n\r\n### Reproduction Link\r\n[UWPMemoryLeakXamarinBugzilla.zip](https://github.com/xamarin/Xamarin.Forms/files/1542007/UWPMemoryLeakXamarinBugzilla.zip)"}}
{"actor":{"display_login":"jassmith"}}