EventHandlerList+ListEntry and PropertyStore

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:
screenshot.jpg

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.

Comments

  • Paul.MartinPaul.Martin Posts: 83 New member
    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.
Sign In or Register to comment.