Help identifying leaks

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Guest

Help identifying leaks

Post by Guest » Mon Nov 21, 2005 11:15 pm

Hi,

We have a relatively complex WinForms 1.1 project. I've been tasked with memory leaks investigation. I'm currently evaluating your product, which has helped me already to identify several leaks! I'm stuck trying to fix the remaining of the issues and was hoping to get some help or perhaps a push to the right direction.

Basically, I've gotten to a point where disposed form reference is not collected. Using integrated your VS.NET 2003 UI, I check form's class instance details and then go to reference details. The problem is that I only get 1 root path with all of the instance names coming from the FCL (i.e. not any of our types). I've got some hashtable at the top of the root path.

I watched all of your lessons and that was very helpful btw, 2nd lesson in particular. I just can't figure out where to go from here. Any help would be very much appreciated. Thanks.

Sergey Mishkovskiy
OpenSpan - Unify Your Vision
www.openspan.com

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Tue Nov 22, 2005 7:05 pm

A Hashtable can often be involved when you have a memory leak, but without any additional information, it's hard to tell why it is holding on to your instance.

Is it possible for you to post the root path that is holding on to your form, or send a zipped session file, containing the "leaking" form, to support@scitech.se
Best regards,

Andreas Suurkuusk
SciTech Software AB

Guest

Post by Guest » Tue Nov 22, 2005 9:09 pm

Andreas,

I think I have it figured out. Our WinForms application essentially is a mini Visual Studio. Among many features it provides form designer based on one built into FCL.

I know that run-time caches a lot of type information for designers, hosts, type converters and types in general. That's what I think was happening. I ended up forcing it to unload design component's type information after it has been disposed via TypeDescriptor.Refresh(designComponent). That took care of it in "New and Live Instances" view.

Have you ever seen this kind of solution applied to such a problem before? Thanks.

Guest

Post by Guest » Wed Nov 23, 2005 6:28 pm

I have never looked at the TypeDescriptor.Refresh method, but if you want to avoid having "New instances" when caching is involved you usually have to call some method to clear the cache. In your case it seems like the TypeDescriptor.Refresh method clears the cache.

Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests