Microsoft Knowledge Base Email Alertz

When you run an application that contains components that are derived from the

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 312118 - Last Review: January 23, 2004 - Revision: 7.2

The system memory usage and the handle counts increase more than you may expect when your application contains components that are derived from the System.EnterpriseServices.ServicedComponent class

This article was previously published under Q312118

SYMPTOMS

Note This article refers to the following Microsoft .NET Framework Class Library namespace:
System.EnterpriseServices.ServicedComponent
When you run an application that contains components that are derived from System.EnterpriseServices.ServicedComponent, the system memory usage may increase to more than 60 percent of the available memory. For example, if you run an ASPX application, the system memory usage may increase. Handle counts may also increase more than you expect. High CPU usage may be indicated in Windows Task Manager while the Req/Sec value remains at a reasonable level. If you examine managed heaps and unmanaged heaps, you find no evidence of memory leaks or of handle leaks. When Object.Finalize requests stop, the memory usage and the handle count eventually fall to more reasonable levels.

CAUSE

This problem may occur if the current version of the common language runtime is limited to one finalizer thread. If there are many worker threads manipulating managed finalizable objects, the finalizer thread can fall behind. In this scenario, the finalizer thread can fall behind especially if significant work occurs in the finalizer of each object. Serviced components may be vulnerable to this design issue because handles are held alive based on the COM+ object context. This is also true of other managed objects with complicated finalizers.

RESOLUTION

To resolve this problem, follow the common language runtime coding pattern by calling the Dispose method and the Dispose object when you finish with the managed objects that support IDisposable. Service component is a managed class that supports IDisposable.

APPLIES TO
  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 1.0
Keywords: 
kbprb kbreadme KB312118
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate