Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my Silverlight application using so much un-managed memory?

I have a rather simple Silverlight application, lately we've been having reports from users of the application crashing after several hours of use (4+). We started digging into the application and noticed that the un-managed portion of memory being used by the application starts very high and continues to grow unchecked. The other heaps seem to be managed just fine. I've done a lot of research and even went as far removing all images from my application and the un-managed memory continues to grow.

I'm just confused at this point as to what exactly is consuming all the un-managed memory in my application and what I can do about it. Here is a snapshot of my application after initial load, as you can see it's already using over 100MB of un-managed memory space. I'm just looking for any guidance here on what objects could be in un-managed memory and what to do to reduce the amount of un-managed memory my application is using. Thanks!

Ants Memory Snapshot

I've taken another snapshot or two using the .NET Memory Profiler and it appears that the Kernel-HeapMemory is the largest chunk. Not sure if this helps much but I thought I would post it anyway.

enter image description here

like image 495
Omikron Theta Avatar asked Nov 13 '22 14:11

Omikron Theta


1 Answers

Have you tried the CLR Profiler for Silverlight? I've used it with some success in the past to troubleshoot memory issues.

like image 178
Ken Smith Avatar answered Dec 18 '22 08:12

Ken Smith