FIX: Managed memory increases over time when you perform asynchronous network calls

This article has been archived. It is offered "as is" and will no longer be updated.
A pinned object is an object that the garbage collector cannot move in memory. In a .NET process, if you perform operations that directly or indirectly pin objects in memory that is managed by the .NET garbage collector, the process can experience sustained memory growth.

To determine if pinning is occurring for a specific process instance, verify the following in Performance Monitor (PerfMon):
  • In the .NET CLR Memory counter, high values appear in the # of Pinned Objects category and the # Bytes in all Heaps category.
  • In the Process counter, a high value appears in the Private Bytes category.
High values in these counters may indicate that you have this problem.
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version       Size       File name   --------------------------------------------------------------   01-May-2003  12:43  1.0.3705.419    196,608  Aspnet_isapi.dll   01-May-2003  12:43  1.0.3705.419     69,632  Corperfmonext.dll   01-May-2003  12:43  1.0.3705.419    303,104  Mscorjit.dll   04-Apr-2003  10:20  1.0.3705.419  1,953,792  Mscorlib.dll   03-Apr-2003  21:30  1.0.3705.419  2,269,184  Mscorsvr.dll   03-Apr-2003  21:30  1.0.3705.419  2,269,184  Mscorwks.dll
More information
The following are operations that may directly or indirectly pin objects in managed memory:
  • Operations that directly pin objects
    • If you use the fixed keyword in an unsafe context

      Note An unsafe context is required for any operation that involves pointers.You can apply unsafe as a modifier in the declaration of callable members such as methods, properties, constructors, and extenders (but not of static constructors).
    • If you perform GCHandle.Alloc(a, b, GCHandleType.Pinned) in C# managed code
  • Operations that in directly pin objects
    • If you call to a Web service by invoking the generated Web service proxies
    • If you make HTTP requests by using the HttpRequest class.
    • If you call to the synchronous Receive function on a Messaging.Queue object (buffers are pinned during the Receive call)
You can monitor this behavior by viewing the following PerfMon counters:
  • .NET CLR Memory - #Bytes in all Heaps will increase
  • .NET CLR Memory - # of Pinned Objects will be at a high number (greater than 100)
For additional information about how to use PerfMon, click the following article number to view the article in the Microsoft Knowledge Base:
248345 How to Create a Log Using System Monitor in Windows 2000
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Article ID: 817618 - Last Review: 10/26/2013 10:49:00 - Revision: 2.0

  • Microsoft .NET Framework 1.0
  • kbnosurvey kbarchive kbhotfixserver kbqfe kbnetframe100presp3fix kbfix kbbug KB817618