Question about ASp.NET Architecture

  • Thread starter Thread starter Robert Millman
  • Start date Start date
R

Robert Millman

I have a question about the ASP.NET architecture and how
classes are instantiated.

When a web page invokes a static class and the class uses
some static storage within the class, does the static
storage exist beyond the invocation of the web page? Is
the static storage global and available to all threads
that might invoke the static class?

Robert Millman
 
Static classes are stored in the application heap, which means that values
in a static class are persistent for the lifetime of the application and are
accessible to all objects in the application. Static classes are not
instantiated, meaning that there is only one copy of the class.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Static classes are stored in the application heap, which means that values
in a static class are persistent for the lifetime of the application and are
accessible to all objects in the application. Static classes are not
instantiated, meaning that there is only one copy of the class.

Beware of the dreadful process recycling feature of ASP.net though... (see
machine.config / search for "ProcessModel")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <[email protected]>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.........................................................................
 
Thanks for the replies. Yes, I do understand the process
recyling issues. However, except for out of process or
database based session state, does not process recycling
affect everything the same way (i.e. application state,
cache, static objects and storage, etc)? If the process
recycles, everything is wiped! Correct??

Robert Millman
 
Wen an Application Pool is recycled, yes, all process memory is wiped clean.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top