ANTS Performance Profiler

Latest version: 7.4

ANTS Performance Profiler

Knowledge Base

Application recycling causes incomplete results and other errors when profiling ASP .NET

Category: Troubleshooting & error messages
Date: 03 Mar 2010
Product: ANTS Performance Profiler
When profiling an ASP .NET web application, incomplete results may be shown. This may be a symptom of an ASP .NET worker process recycling. If the ASP .NET worker process has only one application loaded, it may decide to exit and ANTS Profiler will stop monitoring the application. If this occurs, then it is useful to know the reason why ASP .NET had decided to recycle.

ASP .NET applications are .NET applications that run as independent application domains (AppDomains) in a process dedicated to compiling and executing ASP .NET code (worker process). ASP .NET has a built-in feature called health monitoring, which can "unload" and application and "reload" it into the worker process. At the point of unload, the worker process can decide that it is safe to stop and restart the entire worker process, causing it to disconnect from ANTS Profiler if it is currently being profiled.

An unload can occur for many reasons, such as a maximum memory setting, a number of recompilations being reached, a timeout, or one of the source code files being modified when the application is being run. When you are profiling or debugging an ASP .NET web application, you want to avoid application restarts as they result in incomplete profiling results and/or errors in the ASP .NET profiling session.

If the web application is based on the .NET 1.1 runtime or lower, please see here for the instructions to enable application health monitoring:
http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Profiler&c=knowledgebase%5cANTS_Profiler%5cKB200809000301.htm

ASP .NET 2.0 health monitoring features allow the reasons for an application pool recycle to be written to the application event log. By default, information about the state of the AppDomain is not written to the event log. To turn it on, you can edit the "master" web.config file, normally found in %systemroot%\microsoft.net\framework\v2.0.50727\config.

  - First, look for <healthMonitoring>
  - Inside the healthMonitoring node, find the <rules> node
  - Inside rules, add the following:
<add name="Application Lifetime Events Default" eventName="Application Lifetime Events" provider="EventLogProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom="" />

After saving web.config, any load or unload of the web application will be logged to the application event log. The unload information event will describe the reason for unload so that you can take action to prevent it, either by modifying your processModel or compilation settings for ASP .NET.

In some cases where the application is unloading because code files are being modified, consider temporarily disabling any virus protection to see if this prevents the problem and exclude the "temporary ASP .NET Files" and web application directories from being scanned.

Document ID: KB200809000303 Keywords: ANTS, Profiler,recycle,health,monitoring,incomplete

Was this article helpful?

Search support
Forums

ANTS Performance Profiler

all products