HighTechTalks DotNet Forums  

Stumped: What Garbage Collector?

Dotnet Framework (Performance) microsoft.public.dotnet.framework.performance


Discuss Stumped: What Garbage Collector? in the Dotnet Framework (Performance) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Billg_sd
 
Posts: n/a

Default Stumped: What Garbage Collector? - 10-21-2004 , 06:29 PM






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



Reply With Quote
  #2  
Old   
Alvin Bruney [MVP]
 
Posts: n/a

Default Re: Stumped: What Garbage Collector? - 10-21-2004 , 08:03 PM






are you manipulating very large datasets?
what are you doing that is taking so much memory?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote

Quote:
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





Reply With Quote
  #3  
Old   
Billg_sd
 
Posts: n/a

Default Re: Stumped: What Garbage Collector? - 10-21-2004 , 10:21 PM



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

"Alvin Bruney [MVP]" wrote:

Quote:
are you manipulating very large datasets?
what are you doing that is taking so much memory?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote in message
news:9E08B385-A68F-464C-AE40-C475C70F169E (AT) microsoft (DOT) com...
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






Reply With Quote
  #4  
Old   
Sriram Krishnan
 
Posts: n/a

Default Re: Stumped: What Garbage Collector? - 10-21-2004 , 11:28 PM



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

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote

Quote:
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

"Alvin Bruney [MVP]" wrote:

are you manipulating very large datasets?
what are you doing that is taking so much memory?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote in message
news:9E08B385-A68F-464C-AE40-C475C70F169E (AT) microsoft (DOT) com...
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








Reply With Quote
  #5  
Old   
Billg_sd
 
Posts: n/a

Default Re: Stumped: What Garbage Collector? - 10-22-2004 , 11:25 AM



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.

"Sriram Krishnan" wrote:

Quote:
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

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote in message
news:E4D1572C-6385-43B2-A1F4-5BBCF40E3643 (AT) microsoft (DOT) com...
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

"Alvin Bruney [MVP]" wrote:

are you manipulating very large datasets?
what are you doing that is taking so much memory?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote in message
news:9E08B385-A68F-464C-AE40-C475C70F169E (AT) microsoft (DOT) com...
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









Reply With Quote
  #6  
Old   
Stuart Carnie
 
Posts: n/a

Default Re: Stumped: What Garbage Collector? - 10-22-2004 , 11:41 AM



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

"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.

"Sriram Krishnan" wrote:

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

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote in message
news:E4D1572C-6385-43B2-A1F4-5BBCF40E3643 (AT) microsoft (DOT) com...
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

"Alvin Bruney [MVP]" wrote:

are you manipulating very large datasets?
what are you doing that is taking so much memory?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote in message
news:9E08B385-A68F-464C-AE40-C475C70F169E (AT) microsoft (DOT) com...
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











Reply With Quote
  #7  
Old   
The great MaGeOs
 
Posts: n/a

Default Re: Stumped: What Garbage Collector? - 10-29-2004 , 05:27 PM



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.

"Billg_sd" <Billgsd (AT) discussions (DOT) microsoft.com> wrote

Quote:
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






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.