ASP.Net DLL Memory behaviour

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everybody,

I hope that someone can answer this questions for me. When somebody connects to a ASP.Net site, the site's DLL is loaded into memory. When throughout the user's browsing, will the DLL be removed from memory?

To make myself clearer, I'll explain what I need. I have developed a site that contains a static class. I use this class as a container for the session information of the user, once he's logged in. Now it seems that the information is stored correctly for a while and then the class is empty again. What I need to know is how long the DLL stays in memory and what are the parameters that affect its lifetime so that I know if my solution will or will now work.

Sami Samir
 
Okay here's my line of thought.#
* your web application ie asp.net applicatioin is compiled to an assembly
(which has a dll contrainer)
* first instance of a user (could be anyone... all that matters is the first
time the application receives a request) connecting to the application cause
the
aspnet worker processes to look for a JIT'd version, if not present requests
that the assembly be JIT'd.
* the compliation depends on the number of classes the system needs to
compile in order to display the first aspx page.
* the native copy is discarded if it hasnt be loaded for a while or the if
the original assembly was modified (checks the time stamp)
* it all removes the JIT'd version if the worker process has been started.
( for this you need to look into Process Model in Machine.Config file)
* there are ways to keep it alive... ie timed requests to the site.

as for your static class, it will be in memory till the application is
restarted (changes in machine config(causes all applications to restart), or
applications web.config (restarts current application) or the original
assembly or the worker process being )restarted.
 
Back
Top