Page 1 of 1

Is there a mem leak?

Posted: Thu Mar 15, 2007 7:18 pm
by SJ
I have a Windows application.This application opens a list of tools after the user chooses a tool from a tree view.
I get the below profiler resutls.Is there a memory leak?
Is it correct that there are 0 removed instances even after the form is closed and a heapshot is taken?

Live instances

Total New Removed
ToolView.Data/ChildTool 708 708 0
ToolView.Data/LotList 995 989 0

ToolView.Data/AlertList 3522 3505 0
ToolView.Data/LoadPortList 732 731 0

ToolView.Data/Alert 134 128 0

ToolView.Data/Lot 1282 1276 0
Anything wrong here?

Posted: Fri Mar 16, 2007 5:27 pm
by Andreas Suurkuusk
If you have tool window that you have closed and still have live instances of the data that was shown in the windows, it seems probable that you have a memory leak. I don't know the specifics of your program, but I suggest that you take a look at the root paths of the instances that might be part of a memory leak. In the class details view you can get a summary of all the shortest root paths of all the instances of the selected class. The root paths tell you why the instances have not been garbage collected and should be able to give you a clue whether it is actually a memory leak, or if there is a possibility that the instances might be needed in the future (e.g. be reused when you open a new Tool window).
You can also investigate the allocation call stacks to get information on why the instances were created.