Welcome to Cactus Juice Sign in | Join | Help

Cameron Scholtz's Blog

Enthusiasm Always Wins
Troubleshooting Memory Leak on IIS 5.0 (dllhost.exe)

How do you pinpoint a memory leak in ASP on IIS 5.0? Other than create virtual directories and such, it's been years since I did any real admin work with IIS. But yesterday I researched a reported memory leak on one of our Windows 2000 servers. Some of this was new to me and since I put it into a huge email I thought it'd make a good blog post...or not.

t thing's first. A little background on this file. Windows 2000 runs Internet Information Server (IIS) 5.0, which has three isolation levels: Low, Medium and High. Let's recap them shall we.

  1. Low Anything in Low is run in inetinfo.exe. This is fastest but any apps running in Low can of course take down the server.
  2. Medium (AKA "Out of process"). This is the default. Medium is out of process because the applications run in dllhost.exe. ASP applications configured to run as Medium share a single process space. In other words they all run under the same instance of dllhost.exe.
  3. High Creates a new dllhost.exe instance (also out of process). If any ASP crashes, the Web server does not! The ASP application is automatically restarted. Each ASP application that is configured to run as High runs in its own process space (it's own instance of dllhost.exe) thus protecting ASP applications from each other. Drawback is that it requires a separate process for each ASP application...which can add up to a lot of overhead the more apps that are configured to run this way.

Several things can create an instance of dllhost.exe:

  • COM+ services = 1 instance (the System package)
  • Medium isolation sites/virtual directories = 1 instance
  • High isolation site/virtual directory = 1 instance
  • Each COM+ package that is configured as a Server Package = 1 instance

dllhost.exe takes 10mb memory. So in and of itself, not a problem. It's what runs inside the dllhost (COM objects, ASP, etc) that counts. The more High Isolation setups you create, the more separation you will acheive and the more PID's (package ID's) you will have to look at. However, more instances will also require more server resources.

This makes it easier to determine what a runaway dllhost.exe is linked to. Since were talking IIS 5.0 there's not a whole lot of options here. (IIS 6.0 and ASP.NET introduces more robust application pooling.)
What other options are there?

IIS Exception Monitor I did some reading up on IIS 5.0 (I laughed, I cried) and one thing to maybe try is install IIS Exception Monitor. The way I interpreted this there is a way to use it to determine which ASP is misbehaving.
Performance Counters The following apply to ASP. Active Server Pages: Requests/Sec, Active Server Pages: Requests Executing, Active Server Pages: Request Wait Time, Active Server Pages: Request Execution Time, and Active Server Pages: Requests Queued
IIS 5.0 Tuning See the section toward the bottom of this page regarding "Process Accounting". PA might be a way to isolate the misbehaving ASP.
Final Thoughts. dllhost.exe does not leak memory. It's the COM or ASP running inside it. It seems to me that if using IIS 5.0 the preferrable course of action is to upgrade to IIS 6.0..or IIS 7.0. If that's not an option then I recommend configuring IIS 5.x to isolate web applications into their own process in order to detect which COM or ASP has a memory leak.

Posted: Thursday, November 09, 2006 6:04 PM by Cameron

Comments

No Comments

Anonymous comments are disabled