AlexS
Thu Jul 22 17:38:52 CDT 2004
Hi,
you'll be better off if you dispose everything what is IDisposable. And even
much better if you profile app for allocations, for example with
CLRProfiler, which you can get free from MS site.
You might have issues with memory even with code like this:
using (Brush b = new SolidBrush(Color.Black)) {
...some painting
}
If you call this is in loop or you have too many paints you will finish with
thousands of brushes in heap just because GC is not able to collect all
freed ones.
You might want to check also
http://msdn.microsoft.com/architecture/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp
for additional details on how to deal with GC. But profiler is your best bet
to find what is eating memory and why,
HTH
Alex
"JMArroyave" <JMArroyave@discussions.microsoft.com> wrote in message
news:B57BEBD2-B165-44C7-B1EA-C3DA0D781713@microsoft.com...
> Hi Sunny, and what about the dataset.dispose
>
> "Sunny" wrote:
>
> > If some class implements IDisposable, or has Dispose() or Close(), most
> > probably this class holds some unmanaged resources and it is recommended
> > to call Dispose or Close once you are done with it. But I see no reason
> > to use Dataset.Clear().
> >
> > Sunny
> >
> > In article <2CE051DC-6B16-4690-B4A5-AD4CDE8C1F01@microsoft.com>,
> > JMArroyave@discussions.microsoft.com says...
> > > Hi, im have a trouble with the memory, my app is to big and it
consumes a LOT of memory, i read the posts of dispose in the forum, and all
recomends to leave the GC do this work for managed resources, should i
dispose the datasets and other graphic objects in my app?
> > >
> > > Thanks a lot
> > >
> >