Memory leak cripples apps and requires a restart of IIS

Memory leak cripples apps and requires a restart of IIS

I am supporting an application that has a known memory leak which the vendor is not anticipating fixing. The memory leak causes the dllhost.exe process to utilize large amounts of memory. When the memory utilization for this process approaches the 500,000KB range it cripples the app and requires a restart of IIS. I can prevent this by monitoring the dllhost.exe process and choosing to 'end process' when memory utilization for this process nears 500,000KB.

This is a completely manual process. Is there a way to automate this? I tried playing with IIS scheduling but restarting IIS brings down the site all together. Ending the process on dllhost.exe is much cleaner and it allows the users to continue to use the app. Any help you can provide would be greatly appreciated.

    Requires Free Membership to View

    By submitting your registration information to SearchWinIT.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchWinIT.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Ah, memories. This takes me back to 1999, when all Web applications work this way. Well, we both know that the "right" answer is to replace the application, but often the cost associated with upgrading an application is greater than the cost of implementing a hack work-around. So, let's explore the hack.

You don't mention what OS you're running, but I'll bet it's Windows 2000. I would suggest using the Performance Logs And Alerts snap-in in the Performance tool, and creating a creating an alert that is triggered when the memory used by the dllhost.exe process is greater than, say, 250,000KB. To do this, first use System Monitor to watch the Pool Paged Bytes, Virtual Bytes, and Working Set counters in the Process performance object for the dllhost instance. Pick whichever counter most obviously indicates an impending problem, and note the value when you want to kill the process.

Then, use the Performance Logs And Alerts snap-in (also available in the Performance console) to add an alert using the Process performance counter of your choice. Have the alert launch an executable or batch file that kills the process from the command-line, such as TSKILL. The command "TSKILL dllhost.exe" would do this. If you need to run a separate command to re-launch the application, put both TSKILL and this second command in a batch file, and call the batch file from the alert.

This was first published in April 2004

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.