6 July 2005

DllHost Memory Leak

Posted by Mikhail Esteves under: Tips; Windows .

When memory leaks occur in IIS scripts, you will find DLLHost.exe eating up a lot of memory and ultimately reaching a point where you will need to restart IIS to get the service working again… One way to contain this automatically is to use the Performance Logs and Alerts snapin.

  1. Create a batch file that does nothing but run tskill /a dllhost
  2. Surf to Control Panel | Administrative Tools | Performance
  3. Open up Performance Logs and Alerts
  4. Right-click on Alerts and click New Alert Settings. Name it “Auto-kill DLLHost”.
  5. Click the “ADD” button, choose the computer, choose Memory and then create an alert for 1GB.
  6. In the Action tab, choose Run this Program and set it to run the batch file you created above.

Now, every time memory crosses 1GB usage, the dllhost process is automatically killed.

The next thing you need to do is go through all your scripts again and find what is causing the memory leak — maybe an unclosed loop either in your scripts or in a third-party component you’ve used?

Technorati Tags , ,


2 Comments so far...

dk Says:

7 November 2005 at 5:33 pm.

Evidently this is a known Microsoft issue. MS made a “fix” for this, it is a file called IIS5recycle. use that search term on MS’s site and you will find it. It runs as a service and allows you control conditions to kill dllhost, such as memory thershold, page requests, time, timer, etc. It runs as a service and will also do logging. It is funny how MS acknowledges a memory leak problem, but instead of fixing the cause, the build a band-aid for the symptom.

Be warned: I believe one of MS’s latest patches breaks the IIS5recycle.

Memory leaking in Contributor « ykud Says:

14 November 2006 at 3:45 pm.

[…] A vile and mean way of killing dllhost.exe, after it reached some limit. That is done easily, as noted here, for example. That can lead to some trouble, though, for example if dllhost is killed in the middle of reconcile process. […]

Leave a Reply

Browse

Photography

Projects

Pages

Calendar

July 2005
M T W T F S S
« Jun   Aug »
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

www.flickr.com

Use OpenDNS