Select to view content in your preferred language

Silverlight 4 Memory Issues

981
7
08-11-2010 11:12 AM
AaronConnolly
Regular Contributor
Hey Gang,

Has anyone here, or on the Silverlight development team noticed any memory leak issues similar to those described (and confirmed by Tim Heuer) here:

Memory Leak Issues with inline DataTemplates in XAML

Our application uses many, many ControlTemplates, Style resources, some in-line, some not, a few Telerik Controls (which makes heavy use of in-line DataTemplates), and several ESRI Silveright controls. We've noticed that our application steady chews up memory and never returns it to the heap at all during its time of execution.

I'm not blaming anything on ESRI here, mind you, but we've observed and prototyped one of the many scenarios described by users in the link above. How about you guys? Have you seen any serious memory problems yet with Silverlight 4 related / pertaining to DataTemplates / ControlTemplates etc ... ?

If so what's your position on the problem? We're waiting / hoping for a fix from MS soon.

Thanks in advance, for the time and help,
- Aaron
0 Kudos
7 Replies
AaronConnolly
Regular Contributor
Hey Gang,

Has anyone here, or on the Silverlight development team noticed any memory leak issues similar to those described (and confirmed by Tim Heuer) here:

Memory Leak Issues with inline DataTemplates in XAML

Our application uses many, many ControlTemplates, Style resources, some in-line, some not, a few Telerik Controls (which makes heavy use of in-line DataTemplates), and several ESRI Silveright controls. We've noticed that our application steady chews up memory and never returns it to the heap at all during its time of execution.

I'm not blaming anything on ESRI here, mind you, but we've observed and prototyped one of the many scenarios described by users in the link above. How about you guys? Have you seen any serious memory problems yet with Silverlight 4 related / pertaining to DataTemplates / ControlTemplates etc ... ?

If so what's your position on the problem? We're waiting / hoping for a fix from MS soon.

Thanks in advance, for the time and help,
- Aaron


Anyone? Anyone? Beuller?
0 Kudos
dotMorten_esri
Esri Notable Contributor
We are aware of the issue with Silverlight, but no we have not seen any significant memory issues regarding this bug.
Are you saying you are seeing issues with the API, if you strip out all the other stuff from your application?
0 Kudos
AaronConnolly
Regular Contributor
Hello Morten,

Thanks for the reply. We haven't seen any problems with the ESRI Silverlight API. I just wanted to know if you guys had observed this problem in the wild.

Unfortunately we're experiencing severe memory issues with our application so I'm just trying to investigate all areas of the application that could possibly be causing problems.

Thanks,
- Aaron
0 Kudos
LisaChesley
Emerging Contributor
Good morning, Aaron!

I am currently developing two applications, and both suffer from memory leaks.  One of them I solved by taking any and all inline data templates and moving them to resources instead.  The other one still has an *awful* memory leak, and I'm not having much success plugging that one.

The one that is still leaking doesn't have any data templates to speak of, inline or otherwise, so it doesn't seem to match up with the known Silverlight memory leak.

If I have any success in determining the cause of the leak, I will post here, just in case others are suffering as we are. 😉

NOTE: I do not think the ESRI Silverlight API is causing the leak, I'm just posting here to commiserate with Aaron, and share information.

Thanks, and have a great day!

Lisa
0 Kudos
DougCollins
Regular Contributor
We are seeing a severe memory leak when we repeatedly refresh a point layer using a timer.
Our code uses the latest Microsoft Silverlight 4 SDK Sept2010, and the latest ESRI Silverlight API 2.0.
We have narrowed it down to the "refresh" on our ArcGISDynamicMapServiceLayer layer.

Code snippet:

string service_Name = dynamicLayerList.ServiceName;
if (service_Name.Contains("Sensor") == true)
{
    ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer dynamicServiceLayer =
      MyMap.Layers[service_Name] as ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer;

      dynamicServiceLayer.DisableClientCaching = true;
      dynamicServiceLayer.Refresh();                  // <-- causes memory leak
      // We tried to set it to null, but does not help
      dynamicServiceLayer = null;
}

Is there something we are missing or that we need to do to prevent this from leaking memory?

Thanks, any help would be appreciated.

Charlie
0 Kudos
DarinaTchountcheva
Frequent Contributor
Hi Charlie,

Thank you for your post!
I have experienced the same behavior with the ArcGISDynamicMapServiceLayer last Friday.
I am programmatically changing Opacity, VisibleLayers and LayerDefinitions, calling Refresh after that.

After a few calls to the Refresh the memory consumptions jumps very high, and the application becomes unusable, or very slow.

I had to change my design and avoid using the ArcGISDynamicMapServiceLayer - it was possible in my scenario.

Hope, this will be resolved soon!
0 Kudos
DougCollins
Regular Contributor
Hi Darina,
Thanks for your reply.  This does seem to be a real problem, particularly if you are calling refresh repeatedly to get the latest data (ex. location or sensor update) on a point or points.

I wonder if this will be addressed in the latest ArcGIS Silverlight version (beta 2.1)?
Any ideas?

Thanks,
Charlie
0 Kudos