Connecting Tech Pros Worldwide Forums | Help | Site Map

Garbage Collection in ASP.NET

IDoNothing
Guest
 
Posts: n/a
#1: Nov 18 '05
How does garbage collection work for custom objects
instantiated during a Page_Load or during some other
processing of an ASP.NET page?

Are objects garbage-collected in the same manner using
generations 0, 1, 2, the finalization list and the
freachable queue? Does this apply for the Page object as
well?



Alvin Bruney
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Garbage Collection in ASP.NET


Yes, the qualifying condition is that these objects must be managed
resources. You are responsible for freeing unmanaged resources. It is
theoretically possible to have a garbage collection at every postback if
there is sufficient memory pressure because of the stateless nature of the
web. When a page is torn down, no references exist to local objects and
unpooled resources so collection is entirely at the discretion of the
runtime. This would not apply to objects with roots for example global
objects. What problems are you experiencing?

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"IDoNothing" <expertarchitect@aol.com> wrote in message
news:06a401c3d6d0$97d13e00$a001280a@phx.gbl...[color=blue]
> How does garbage collection work for custom objects
> instantiated during a Page_Load or during some other
> processing of an ASP.NET page?
>
> Are objects garbage-collected in the same manner using
> generations 0, 1, 2, the finalization list and the
> freachable queue? Does this apply for the Page object as
> well?
>
>[/color]


Closed Thread