Well, I faced a similar problem in the recent past and also found this problem for many, so I decided to write an article for consolidating the same. First of all, there is a difference between Application Pool and an Application Domain which is as follows
Application Pool : An Internet Information Services (IIS) application pool is a grouping of URLs that is routed to one or more worker processes. Because application pools define a set of Web applications that share one or more worker processes, they provide a convenient way to administer a set of Web sites and applications and their corresponding worker processes. Process boundaries separate each worker process; therefore, a Web site or application in one application pool will not be affected by application problems in other application pools. Application pools significantly increase both the reliability and manageability of a Web infrastructure. For more details, refer to the following Link.
Application Domain : A boundary that the common language runtime establishes around objects created within the same application scope (that is, anywhere along the sequence of object activations beginning with the application entry point). Application domains help isolate objects created in one application from those created in other applications so that run-time behavior is predictable. Multiple application domains can exist in a single process. For more details, refer to the following Link.
So the problem faced by majority of us is as follows:
When does Application Pool Restart?
There are two types of reasons when an application pool recycles.
- Scheduled Application Pool Recycling
- Abrupt Application Pool Recycling
Some More Information:
To configure the Scheduled Application Pool recycling please refer the following links: For IIS 6 and For IIS 7 Now in case you wan to stop the Scheduled Application pool recycling, you can specify it in the settings of Application Pool.
But it is highly recommended by Microsoft not to do so.
Abrupt Application Pool Recycling There are a multiple reasons for this.
They are as follows:
1. Any modifications in the Application’s BIN Directory
2. Making changes in any Configuration File/s, like Web.config or others ( if you have any specific config file in your application say in a directory called App_Config).
3. Making modifications in the Source code files in APP_CODE Directory. This maybe change in any Source code files, or adding or deleting files from this directory.
4. Making changes in the Global.asax file
5. Making Changes in the Machine.config file.
6. Making any modifications in the Web Application’s Root Directory. This means creating files/subdirectories on the fly can lead to application pool recycling.
7. Modifications for references of Web Services of App_WebReferences directory.
8. Modifying the Security Settings of any directory in the Root directory. (Like specifying read security rights for everyone or any other specific user or user group.)
This was just a brief info on IIS Application Pool Restart.
For more details, please refer to the references:
1.http://support.microsoft.com/kb/332088
6. http://forums.iis.net/t/1153736.aspx
Hope this Helps!
Good work Varun. Keepit Up
Thanks Krunal for your energetic words!
Hi! I simply would like to give you a huge thumbs up for your great info you have got here on this post.
I am returning to your website for more soon.
Thanks Georgina,
Keep visting and keep sharing!
Regards,
Varun Shringarpure
we are having issues with memory leak in sitecore site until we fix the root cause, we are recycling app pool every week. does recycling app pool every week causes any issue.
Hi Venki,
No weekly recycling wont cause any issue in case your solution has memory leaks.
Infact, its better that you recycle it.
Also, to dig in more into the issue of memory leak, and finding effective solution to it, I would suggest you to refer to the following link:
http://www.dotnetfunda.com/articles/article625-best-practices-no-5–detecting-net-application-memory-leaks-.aspx
Let me know if this helps, or I can be of some help to you!
Regards,
Varun Shringarpure