Memory Leaks

Thread is closed for posting
2 posts, 0 answers
  1. Wesley Witt
    Wesley Witt avatar
    12 posts
    Member since:
    May 2005

    Posted 18 Feb 2014 Link to this post

    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.
  2. Deyan
    Deyan avatar
    2147 posts

    Posted 19 Feb 2014 Link to this post

    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.

    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.
Back to Top