ToolBar. Both of these hook onto evens in the ImageList you give them, and
they do not unhook when they are disposed. Hence, there will be a leak if
you use a static ImageList. What you need to do is to write a class that
"david" <david10708@lycos.com> wrote in message
news:%23ohNAxSEEHA.2932@tk2msftngp13.phx.gbl...
> Hi,
> Following Matt's suggestion, I made big progress. Thanks again, Matt.
>
> Now I narrowed the problem.
>
> In my code, I have a global shared imagelist.
>
> If I pass the imagelist to objects, the objects can not be released
clearly,
> it keeps reachable.
>
> I tried to remove the imagelist from one of my objects, system release
> memory perfectly.
>
> I also tried to dispose imagelist,
> but it can not be resused by other objects any more.
>
>
> Any ideas?
>
> Thanks,
>
> David
>
>
>
>
> "Matt Davey" <Matt.Davey@finetixDOTcom> wrote in message
> news:O0TuFAGEEHA.3424@tk2msftngp13.phx.gbl...
> > You essentially have a resource leak. Try running CLRProfiler/.NET
Memory
> > Profile and seeing what objects are not being GC'd. If you can find out
> the
> > type of object, then you will find the leak.
> >
> > Later
> >
http://weblogs.asp.net/mdavey/ > >
> >
> > "david" <david10708@lycos.com> wrote in message
> > news:u69kFvFEEHA.2652@TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > > I have a windows gui application. It has performance problem. It runs
> well
> > > at morning.
> > > But in the afternoon, System becomes slower then extremely slow until
> you
> > > restart the computer.
> > > I use .NET memory profiler to trace it.
> > > I find Generation #2 keeps growing, never decreases.
> > >
> > > I call "dispose" method for every form at the "Done" event.
> > > Then set form to null.
> > > like:
> > >
> > > Form1.Dispose();
> > > Form1 = null;
> > >
> > > And I manully put GC.Collect() in the code. But it has no performance
> > > change.
> > >
> > > Is this a coding problem or something else?
> > >
> > > Anyone can help?
> > >
> > >
> > > Thanks in advance!
> > >
> > > David
> > >
> > >
> >
> >
>
>