Silverlight Application UserControl Memory Release

Use this forum to read, ask or inform about memory issues in the .NET Framework and third party components.

Moderator: SciTech Software

Silverlight Application UserControl Memory Release

Postby dkrish2020 » Mon Sep 15, 2014 8:02 am

We have a Memory Leak issue. on opening form it is using nearly 15 MB and after closing it is releasing around 5 to 7 Mb . i had disposed all the objects in Dispose method.

Is it possible to release total memory which it is used in Loading of Form about 15 Mb. ??

If it is not releasing total memory does it means still we have memory leak in application ??

when i verified with this tool it is showing .net framework references which cannot be disposed around 200 kb.
dkrish2020
 
Posts: 5
Joined: Mon Sep 15, 2014 7:58 am

Re: Silverlight Application UserControl Memory Release

Postby Andreas Suurkuusk » Wed Sep 17, 2014 12:50 pm

It is possible that not all of the memory allocated when opening the form will be released when you close the form, especially when you open the form for the first time. The unreleased memory can be used by things that are loaded during one-time initialization, e.g. theme data.

If the memory usage keeps increasing each time you open and close the form, then there might be a memory leak. To get information about whether there's a leak or not, I suggest that you investigate types with new instances and look at the root paths of the instances. You can also try to use the memory leak guide in the profiler.
Best regards,

Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
 
Posts: 977
Joined: Wed Mar 02, 2005 7:53 pm
Location: Sweden

Re: Silverlight Application UserControl Memory Release

Postby dkrish2020 » Wed Sep 24, 2014 7:28 am

Thanks for the Reply !!!! I verified in using TaskManager when closing form it is not releasing total memory . one of our clients are complaining memory leak issue memory in Task Manager is growing up. when closing form it releases some amount of memory not total used memory . Can You suggest me how to explain them in proper way ?? Before it was not disposed objects properly now i disposed objects in Dispose method and it releasing some amount memory.
When i verified in memory profiler tool it is showing 100 kb objects are not disposed .But clients are complaining that it is not releasing total memory.
dkrish2020
 
Posts: 5
Joined: Mon Sep 15, 2014 7:58 am

Re: Silverlight Application UserControl Memory Release

Postby Andreas Suurkuusk » Fri Sep 26, 2014 11:59 am

The Task manager cannot be used to decide whether the memory used by the form is released or not. If the .NET runtime allocates 15 MB when showing the form, it will most likely not release all of this memory when the form is closed, even if the memory is no longer in use. The runtime will not know how much memory is actually used by managed instances until a full garbage collection has been performed, and even after that it might decide to not release all of the memory in order to be prepared for future allocations.

If the memory usage in the Task manager continues to increase when you open and close the form multiple times, then you probably have a memory leak. However, the information presented by the profiler is much more detailed and will give you information about how and why the memory is allocated.

You say that the profiler tool is showing that 100 kb objects are not disposed. Is 100 KB the delta live bytes value between two snapshots? This can of course be a memory leak, but is can also be one-time allocated instances that will not be allocated the next time you open the form, or temporary instances that will be cleaned up at a later time. You can investigate the root paths of the new instances to try to decide if they are part of a memory leak or not, or just open and close the form several times and see if the memory usage continues to increase.
Best regards,

Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
 
Posts: 977
Joined: Wed Mar 02, 2005 7:53 pm
Location: Sweden

Re: Silverlight Application UserControl Memory Release

Postby dkrish2020 » Mon Oct 06, 2014 1:08 pm

How can we identify memory is released from form when closing form ??
Can we see in TaskManager ???
dkrish2020
 
Posts: 5
Joined: Mon Sep 15, 2014 7:58 am

Re: Silverlight Application UserControl Memory Release

Postby Andreas Suurkuusk » Tue Oct 07, 2014 7:54 pm

As I mentioned in my previous reply you will most likely not be able to use the Task manager to see whether the memory is released when closing the form. The Task manager presents the private working set of the process, which is affected by many different factors (e.g. overall system memory usage, in addition to the actual memory usage of the process), and the .NET runtime will most likely not release all memory to the OS.

To see whether the memory is released when closing the form you need to collect snapshots using the memory profiler. Collect one snapshot before opening the form and one snapshot after closing the form. The "delta" information of the comparison between the snapshots will provide information about the memory that is not released after closing the form.
Best regards,

Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
 
Posts: 977
Joined: Wed Mar 02, 2005 7:53 pm
Location: Sweden


Return to Known Memory Issues

Who is online

Users browsing this forum: No registered users and 1 guest

SciTech Software logo

© Copyright 2001-2016. SciTech Software AB
All rights reserved.


SciTech Software AB
Kartvägen 21
SE-175 46 Järfälla
Sweden


E-mail: mail@scitech.se

Telephone: +46-706868081

cron