FIX: Error message when you run a SQL Server 2005 application that contains user-defined data types: "AppDomain 3 (<db_name>.dbo[runtime].2) is marked for unload due to memory pressure" (917271)



The information in this article applies to:

  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium Based Systems
  • Microsoft SQL Server 2005 Developer Edition

Bug #: 636 (SQL Hotfix)
Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.

SUMMARY

This article describes the following about this hotfix release:
  • The issues that are fixed by the hotfix package
  • The prerequisites for installing the hotfix package
  • Whether you must restart the computer after you install the hotfix package
  • Whether the hotfix package is replaced by any other hotfix package
  • Whether you must make any registry changes
  • The files that are contained in the hotfix package

SYMPTOMS

When you run a Microsoft SQL Server 2005 application that contains user-defined data types, the following symptoms may occur:
  • A memory leak occurs.
  • An error message that resembles the following is logged in the SQL Server error log:
    AppDomain 3 (<db_name>.dbo[runtime].2) is marked for unload due to memory pressure.
    Error: 6533, Severity: 16, State: 49.
    AppDomain <db_name>.dbo[runtime].4 was unloaded by escalation policy to ensure the consistency of your application. Out of memory happened while accessing a critical resource.

    Error: 6532, Severity: 16, State: 74.
    .NET Framework execution was aborted by escalation policy because of out of memory.
    System.Threading.ThreadAbortException: Thread was being aborted.
    System.Threading.ThreadAbortException:
    at System.RuntimeType.RuntimeTypeCache.MemberInfoCache`1.AddMethod(RuntimeTypeHandle declaringType, RuntimeMethodHandle method, CacheType cacheType)
    at System.RuntimeType.RuntimeTypeCache.GetMethod(RuntimeTypeHandle declaringType, RuntimeMethodHandle method)
    at System.RuntimeType.GetMethodBase(RuntimeTypeHandle reflectedTypeHandle, RuntimeMethodHandle methodHandle) at System.RuntimeType.GetMethodBase(RuntimeMethodHandle methodHandle)
    at System.Reflection.Emit.DynamicScope.GetTokenFor(RuntimeMethodHandle method)
    at System.Reflection.Emit.DynamicILInfo.GetTokenFor(RuntimeMethodHandle method)
  • The number of garbage collection handles for the SQL Server process gradually increases until the application domain is unloaded.

CAUSE

This problem occurs when you repeatedly run an SQL stored procedure that takes a user-defined data type as a parameter. The SQL stored procedure may be the sp_executesql system stored procedure or a stored procedure that you create.

Note These symptoms may be caused by the problem that is described in this article. These symptoms may also be caused by user code that does not release common language runtime (CLR) memory or garbage collection handles.

RESOLUTION

To resolve this problem, apply the cumulative hotfix package (build 2153) for SQL Server 2005 that is discussed in Microsoft Knowledge Base article 918222. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

918222 Cumulative hotfix package (build 2153) for SQL Server 2005 is available

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Modification Type:MinorLast Reviewed:9/22/2006
Keywords:kbBug kbfix kbtshoot kbQFE kbpubtypekc KB917271 kbAudITPRO kbAudDeveloper