Problem with memory leaks

  • Thread starter Thread starter Gupta
  • Start date Start date
G

Gupta

Hi,

Im currently working on a C# appn and facing a problem
with memory leaks.

In our application we have a tabcontrol and tabpage
named "Main" in it. This tabpage has a treeview control
and upon clicking on any node we create a new tabpage and
add it to the tabcontrol.

Currently in our testing we have used the dotnet memory
profiler to take snapshots before creation of a new tab
page and after closing it. Ideally speaking, the delta
should be zero. When we compare the two snapshots we find
the following objects still remaining in memory.

Int32, WeakReference, BindingContext.HashKey and String.
The increase is consistent.

When i checked the call stack of the above instances, they
are getting created when a tabpage is added to the
tabcontrol.
tabCtrl.TabPages.Add(new TabPage());

we couldn't make out why they are getting created and why
not getting disposed.

Request any help on this issue.

Thanks in Advance,
Gupta.
 
Back
Top