This n-tier .Net 1.1 WinForms app I'm working on starts at about 37 MB on
startup, As I use the app:
view crystal reports, perform queries, load various forms
it grows to over 250MB! It eventionally becomes so slow & unresponsive (due
to thrashing) that you have to exit the app & restart. Even when I
deliberately call System.GC.Collect(), I recoup about 1MB RAM. This is
unacceptable.
Furthermore, 90% of the used memory should be reclaimable since:
1) I'm back to the sign-on screen
2) all forms have been closed
3) all ADO.NET, SqlClient & related objects have gone out of scope.
Why can't I reclaim memory?
--Billg_sd
Alvin Bruney [MVP] - 22 Oct 2004 01:07 GMT
are you manipulating very large datasets?
what are you doing that is taking so much memory?

Signature
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
> This n-tier .Net 1.1 WinForms app I'm working on starts at about 37 MB on
> startup, As I use the app:
[quoted text clipped - 16 lines]
>
> --Billg_sd
Billg_sd - 22 Oct 2004 04:21 GMT
Hi Alvin,
Thanks for the response.
I'm not pulling large data sets at all, from 1 to 500 records using
sqlClient Command objects to call Stored Procedures. However, each of the
forms that display the datasets has graphics, Crystal reports, and 3rd party
.Net controls. So it's understandable that it's gonna use a chunk of memory.
It's just that when I exit all such forms (and the forms are no longer
accessable), one would think memory should be returned...especially when I
explicitly call GC.Collect
--Billg_sd
> are you manipulating very large datasets?
> what are you doing that is taking so much memory?
[quoted text clipped - 19 lines]
> >
> > --Billg_sd
Sriram Krishnan - 22 Oct 2004 05:28 GMT
Hmm..use CLR Profiler to see where your RAM is being used. And I really
don't think it is advisable to call GC.Collect as it messes with the
heuristics of the GC

Signature
Sriram Krishnan
http://www.dotnetjunkies.com/weblog/sriram
> Hi Alvin,
>
[quoted text clipped - 36 lines]
>> >
>> > --Billg_sd
Billg_sd - 22 Oct 2004 17:25 GMT
I may go ahead and use the profiler.
Again, most of the allocations are done in MDI child forms, so when you call
form.close(), one would think the garbage collector would collect it,
especially when the parent's form.Close() is called later on.
> Hmm..use CLR Profiler to see where your RAM is being used. And I really
> don't think it is advisable to call GC.Collect as it messes with the
[quoted text clipped - 40 lines]
> >> >
> >> > --Billg_sd
Stuart Carnie - 22 Oct 2004 17:41 GMT
I have also seen where events need to be released on some form controls, or
otherwise there are still root references, and memory will not be freed up.
You may want to do some searching on this, but AQTime 4.x has some
documentation on this.
Cheers,
Stu
> I may go ahead and use the profiler.
>
[quoted text clipped - 46 lines]
> > >> >
> > >> > --Billg_sd
The great MaGeOs - 29 Oct 2004 23:27 GMT
Dispose()!!!!!!
CrystalReports and Database Objects are in most instances use non-managed
resources. Always make sure that you call dispose() on objects before they
go out of scope. We have had similar problems, with bitmap objects that was
solved by calling dispose.
> This n-tier .Net 1.1 WinForms app I'm working on starts at about 37 MB on
> startup, As I use the app:
[quoted text clipped - 15 lines]
>
> --Billg_sd