This is a migrated thread and some comments may be shown as answers.

Memory Leaks

1 Answer 33 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wesley Witt
Top achievements
Rank 1
Wesley Witt asked on 18 Feb 2014, 07:35 PM
I'm seeing a problem where an instance of RadDataBoundListBox is leaking memory.  The leak is coming from the ItemsSource that is assigned to the list box.  I have tried setting the ItemsSource to null when navigating away from the page but that does not seem to help.  I'm also null-ing the collection in my view model.  I don't see where any of my code is holding a reference so I suspect that the UI control must be holding onto the reference somehow.  Is there something else that I need to do to ensure that the memory is released back to the system?

Sending is the code for my app is not really possible as the code base is large and I don't want to send that in.  If I must i could spend the time to create a sample that reproduces the problem, but I'm hoping someone can point me to something obvious that I'm doing wrong or a possible Telerik bug.

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 19 Feb 2014, 01:56 PM
Hi Wesley,

Please refer to the support ticket you've opened regarding the same case.

In short, the reason for the memory consumption issue was that you're always calling NavigationService.Navigate to swap between two pages. This will always create a new instance of the corresponding page and put it on the back stack. Constantly doing this will always consume more and more memory until your app crashes. This will happen sooner or later depending on the UI complexity and the data stored within your pages. You need to use NavigationService.GoBack for cases when you want to go to a page you've already visited.

I hope this helps.

Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
Tags
DataBoundListBox
Asked by
Wesley Witt
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or