Did you try playing with the Session timeout? Usually when the last session
closes down is when the application unloads.
Something else, you may want to instead take a look at the Cache instead of
the Application variables. I've found the cache to be much nicer. Also, for
frequently accessed data, you could write a function that accesses that will
first test to see if the item is in cache if it is, return it, else fetch
the data and put it into the cache.
How much data are you storing? Three minutes is a very long time. Have you
optimized the database for performance? Do you really need to load
everything at once? One of my concerns is, if it takes three minutes to load
you may be trying to load way too much data into memory which would lead you
to other problems down the line. If you have this much data stored in
application variables you may run into long-term performance issues as the
system could run out of assigned resources the longer it runs, forcing the
application pool to restart more often even when users are still connected.
--
Hope this helps,
Mark Fitzpatrick
Microsoft FrontPage MVP 199?-2006. 2007 and beyond
[quoted text, click to view] "Charlie" <Charlie@discussions.microsoft.com> wrote in message
news:D137B6E7-AA58-4861-A7F0-651B1C3B7361@microsoft.com...
>
> I have written an ASP.Net web application in C#.
> On Appplication_Start the code loads some data
> from the database into memory. It stores the data
> in Application State variables.
> The data is read only. So far so good.
>
> If no one uses the Application for a certain period of time
> IIS unloads it from memory. If someone then access the
> application the code reloads all the data again into Application
> State variables.
>
> This takes about 3 minutes to do. Where is the setting
> in IIS or machine.config or app.config or web.config
> that determines the time period of inactivity before
> IIS unloads an application from memory?
>
> Thanks
> Charlie
>