Problem with memory leaks

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gupta

    #1

    Problem with memory leaks

    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.
    [color=blue]
    > tabCtrl.TabPage s.Add(new TabPage());[/color]

    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.
  • Eric Newton

    #2
    Re: Problem with memory leaks

    Eventually these objects will be garbage collected. Trust the framework.


    --
    Eric Newton
    APTItude Solutions
    enewton@aptic.c om.nospam

    "Gupta" <anonymous@disc ussions.microso ft.com> wrote in message
    news:0b1a01c3a4 6a$86a206c0$a40 1280a@phx.gbl.. .[color=blue]
    > 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.
    >[color=green]
    > > tabCtrl.TabPage s.Add(new TabPage());[/color]
    >
    > 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.[/color]


    Comment

    Working...