Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1010965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:09:49+00:00 2026-05-16T09:09:49+00:00

In our SL4 application built on Caliburn.Micro, we’ve come across a (another) memory leak.

  • 0

In our SL4 application built on Caliburn.Micro, we’ve come across a (another) memory leak.

Stripped out, it seems that the problem is caused by ItemsControl with custom DataTemplate bound to an IEnumerable collection of objects that implement INotifyPropertyChanged interface.

When the source collection is changed (another collection is assigned to the ViewModel’s property that the ItemsControl’s ItemsSource is bound to), the entites in the original collection and bound DataTemplates are not garbage collected. Although the event handling of NotifyPropertyChanged seems to be done internally via WeakReference, it is like SL is keeping another reference to these objects. So every time we refresh data from the server, memory consumption increases.

Do you have any idea how to solve this problem?
I really cannot understand how can this kind of bug happen in SL4!

Some experiments suggested that calling ItemsControl.Items.Clear() could help. Any tip how to simply call this every time the ItemsSource is changed? The only thing that comes to my mind would be to override ItemsSourceProperty and add a handler there.

EDIT:
It turned out that the leak occurs in this situation:

  • load entities through RIA services context and store a collection of them in a property of viewmodel
  • bind a listview with custom data template to the property with collection of entites
  • refresh the entites via RIA services context

What happens is that although the entities get refreshed, which can be seen in the view, memory consumption is rising.

If there is no binding, refreshing the entities does not eat more memory (it might but the memory consumption level eventually returns back as GC does its job).

If you clear the context or simply create a new one, the memory is also eventually collected.

It seems that the problem is connected with RIA services.

I can provide a simple project that shows the problem if you want.

UPDATE: The memory leak seems to be caused by INotifyDataErrorInfo. Read here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T09:09:50+00:00Added an answer on May 16, 2026 at 9:09 am

    UPDATE:

    Silverlight 4 Service Release to fix Memory Leaks:
    http://timheuer.com/blog/archive/2010/09/01/silverlight-service-release-september-2010-gdr1.aspx

    Silverlight 4 has known memory leak issues with data templates. There is a fix on the way it’s currently being tested.

    Here is a thread I have been following:

    The user “heuertk” is a Microsoft Silverlight Developer….he explains the issues and the status of the fix…

    http://forums.silverlight.net/forums/t/171739.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our application is interfacing with a lot of web services these days. We have
Our web services are distributed across different servers for various reasons (such as decreasing
I have got an error while trying to upgrade our large project to SL4.
For our Silverlight Project (SL4) I'm using a Model which might contain Lists (
I have got an(other) error while trying to upgrade our large project to SL4.
Our company is currently writing a GUI automation testing tool for compact framework applications.
Our team develops distributed winform apps. We use ClickOnce for deployment and are very
Our team is creating a new recruitment workflow system to replace an old one.
Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding
Our dev shop currently uses Visual SourceSafe. We all know how that could end

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.