Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight Memory Usage

Tags:

c#

silverlight

Is there a way to measure the current memory usage of the silverlight plug-in from within the client side C# code?

I am isolating a memory leak and it would be good to know the current memory usage of the plug-in.

For instance it could be logged to a file before I clicked a button that it was using '60 mb' and after I clicked the button it was using '70 mb' etc. I could then gradually add in controls and use this technique to quantify the leak.


As I mentioned above,

I am more looking for a C# silverlight library call that I can call within my code to get the current memory usage at any particular point in time.

So I am guessing that there isn't a way to do this?

In winforms (and WPF probably) I believe this is possible, but perhaps the stripped back nature of silverlight has excluded this functionality?

like image 622
peter Avatar asked Dec 05 '25 00:12

peter


1 Answers

GC.GetTotalMemory might help you.

like image 109
Vlad Filyakov Avatar answered Dec 06 '25 14:12

Vlad Filyakov