Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Application State Unload

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charlie - 27 Jul 2007 04:32 GMT
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
Mark Fitzpatrick - 27 Jul 2007 06:04 GMT
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.

Signature

Hope this helps,
Mark Fitzpatrick
Microsoft FrontPage MVP 199?-2006. 2007 and beyond

> I have written an ASP.Net web application in C#.
> On Appplication_Start the code loads some data
[quoted text clipped - 14 lines]
> Thanks
> Charlie
George Ter-Saakov - 27 Jul 2007 13:25 GMT
It's defined on a pool level.
Google ".NET application pool" to get more info. Here is qucik link i came
up with http://www.developer.com/net/asp/article.php/2245511

PS: Win XP does not have application pools but you are not suppose to have
production server on xp.

George.

> I have written an ASP.Net web application in C#.
> On Appplication_Start the code loads some data
[quoted text clipped - 14 lines]
> Thanks
> Charlie

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.