EventHandlerList+ListEntry and PropertyStore

Memory profiling for .NET developers

Moderators: StephenC, Alex.Davies, AndrewH, melvyn.harbour

EventHandlerList+ListEntry and PropertyStore

Postby ueberbill » Wed Mar 10, 2010 8:14 pm

We have some memory leaks in our application and I've been tasked with tracking them down using Memory Profiler (what a fantastic piece of software, and you can quote me). The issue is that after using our app for a span of time, our testers get crashes siting an Error Creating Window Handles. We assume we're not properly disposing of our controls and so we've been working with disposing our forms properly. It's not quite there yet, however. Our app has a main form which opens custom controls (which themselves contain many smaller controls- textboxes and the like). The custom controls get closed and opened many times over the course of using the application.

I don't know how big this'll be, but here's a screenshot of a profiler run:

Something I can't seem to get to go away are these EventHandlerList+ListEntry and PropertyStore instances. It seems like these might be keeping our controls in memory (and holding onto their window handles) and causing crashes. Does anyone have experience seeing these in the profiler and if so what was done to dispose of them? I can send more information if necessary. Thanks.
Posts: 1
Joined: Wed Mar 10, 2010 8:00 pm

Postby Paul.Martin » Thu Mar 11, 2010 1:52 pm

The two really useful graphs in ANTS when you are searching for this type of problem is the "Clas Reference Explorer" and the "Object Retention Graph".

If you select either the EventHandlerList+ListEntry or the PropertyStore in the "Class List" and then click on "Class Reference Explorer" analysis. This will show you the classes that are referenced or which it is referenced by - so for EventHandlerList+ListEntry you will get the type of EventHandlers that are contained in the EventHandlerLists - this will give you some clues.

If you then select an instance of either the EventHandlerList+ListEntry or the PropertyStore classes in the "Instance List" and then go to the "Object Retention Graph" this will should exactly what is keeping that instance in memory.

There are lots of likely causes and the best way to be sure is to look at the graphs and just gradually work through them.

Glad you are enjoying using our software.
Posts: 83
Joined: Wed Feb 03, 2010 11:20 am
Location: Cambridgeshire

Return to ANTS Memory Profiler Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests