Sam, I'm building a GIS system with the new Virtual Earth Silverlight control and had a memory leak issue. The good news is I fixed it and it didn't take that long. I used Silverlight Spy to detect the leak and to confirm I had fixed it: http://silverlightspy.com/silverlightspy/download-silverlight-spy/
It turns out I was removing a child element that in turn had child elements that had both events and looping animations. The solution was to implement IDisposable and to stop the animations and detach the events on those objects. So bad news is that Silverlight doesn't magically solve memory leaks, good news is there are good tools to detect them and solutions to fix them. For those interested the scenario was deleting a MapLayer from the Map, the MapLayer contained hundreds of Custom Pushpins with animations, scale transformations hooked to the Map's onchangeViewFrame event and onclick event. It was easy enough to setup a layer to be added and removed every 5 sec in a manual unit test and check using Silverlight Spy. Love to know if people have found a way to automate this sort of test. John. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Sam Lai Sent: Thursday, 30 April 2009 11:49 AM To: [email protected] Subject: Memory leaks and garbage collection Hi everyone, I've been working on a Flex app for a while now, and one of the most annoying things about it are memory leaks due to objects not being garbage collected. I'm not doing anything tricky, but I suspect it has something to do with bindings. The Flex Profiler doesn't always give enough information to exactly pinpoint it either. So as I'm about to start another project along similar lines, I'm wondering if people are experiencing similar issues in Silverlight, and how easy they were to resolve and avoid. Thanks, Sam -- Sent from my mobile device ---------------------------------------------------------------------------- ---- Support procedure: https://www.codify.com/lists/support List address: [email protected] Subscribe: [email protected] Unsubscribe: [email protected] List FAQ: http://www.codify.com/lists/ozsilverlight Other lists you might want to join: http://www.codify.com/lists -------------------------------------------------------------------------------- Support procedure: https://www.codify.com/lists/support List address: [email protected] Subscribe: [email protected] Unsubscribe: [email protected] List FAQ: http://www.codify.com/lists/ozsilverlight Other lists you might want to join: http://www.codify.com/lists
