High memory usage

Dec 15, 2007 at 11:21 AM
I really like the component.
It's very simple to use, but I do notice a high memory usage.
I use it to display about 60 images (~ 60MG in tot).
It uses about 90MG of the computer memory.
For looping album, it kicks over 1G.
For low end computers, it would freeze up due to a lack of resources.
It seems there is a memory leak.
could it be not disposing resources properly?
I think it would be better to release resources when finished with UI elements.
can you do like cache a batch 10 images at a time and release its resources after displaying them?
Coordinator
Dec 15, 2007 at 9:16 PM
Edited Dec 16, 2007 at 5:31 PM

It seems there is a memory leak.
could it be not disposing resources properly?

That is entirely possible. We actually noticed this before and created an issue already. Memory leaks are one of the hardest problems to identify and fix in any software. I'm not convinced that Silverlight itself isn't at least partially the culprit given that it's so new. Plus, we have heard rumors from other people (like the author of Silverlight Spy) that there are memory issues with the core Silverlight.createDelegate method which we're using all over the place.

I'm not sure what you mean by "release resources". If we are holding on to disposable resources, then it's not intentional. Luckily, this project is totally free and open source, so that smarter people than myself can help us fix these issues. Interested? ;)

Does it help the situation if your images weren't so large in size? 1 MB each sounds a bit high for the Web. We are finding that photos can be resized to about 800 x 600 JPEGs (approximately 200K apiece) and still look great, even in full-screen mode.
Dec 16, 2007 at 12:53 PM
Thanks for promptly response to my post.
If you have a chance to view the video in microsoft silverlight's website.

http://www.microsoft.com/silverlight/

The video resources deleted appropriately after it's being closed.
You can view the Task Manager to prove it to yourself.
For Slide Show component, maybe the events handler not dispose them properly causing the IE to hold on to resources.
At this point I am not familiar with the source code to poke around.
That what I was referred to when said about "release resources".
Something along the line like so.

sender.findName("object").removeEventListener("MouseLeftButtonUp", "javascript:myEventFunc")

although I do agree with your suggestion about the image resize, but that is not the nature of the problem though.
It's about managing resources while the app is running for robustness and stability purposes.

Andy

Jun 24, 2008 at 2:23 PM
Any further news on your investigation into the leak?  My show grinds to a halt after about 30 slides.  I see a number of hits when searching "Silverlight memory leak", and was wondering if any of the larger discussion on Silverlight memory leaks applies here. Thanks!

billyzkid wrote:

It seems there is a memory leak.
could it be not disposing resources properly?

That is entirely possible. We actually noticed this before and created an issue already. Memory leaks are one of the hardest problems to identify and fix in any software. I'm not convinced that Silverlight itself isn't at least partially the culprit given that it's so new. Plus, we have heard rumors from other people (like the author of Silverlight Spy) that there are memory issues with the core Silverlight.createDelegate method which we're using all over the place.

I'm not sure what you mean by "release resources". If we are holding on to disposable resources, then it's not intentional. Luckily, this project is totally free and open source, so that smarter people than myself can help us fix these issues. Interested? ;)

Does it help the situation if your images weren't so large in size? 1 MB each sounds a bit high for the Web. We are finding that photos can be resized to about 800 x 600 JPEGs (approximately 200K apiece) and still look great, even in full-screen mode.