.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Server 2005 SP2 - AppDomain was unloaded by escalation policy. Out of memory while accessing a c

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Sql Server

I am posting this in the .NET Framework inside SQL Server forum as I assume the issue is related to CLR / SQL Server.  Please let me know if this is the incorrect forum.

I am receiving the following error in the event log:

AppDomain [DB_NAME].dbo[runtime].5253 was unloaded by escalation policy to ensure the consistency of your application. Out of memory happened while accessing a critical resource. 
System.Threading.ThreadAbortException: Exception of type 'System.Threading.ThreadAbortException' was thrown.

The system that this is occurring on is a Windows Server 2003 R2 SP2 (32 bit), SQL Server 2005 SP2 with 8 GB of RAM:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

9.00.3042.00	SP2	Standard Edition

The CLR assembly is relatively simple and is referenced by both store procedures as well as by a table trigger (update).  Essentially the CLR assembly instantiates an object (in a referenced webservice on a separate&

View Complete Post

More Related Resource Links

Configuring AWE and memory usage in SQL Server 2005

Dear Sirs,
I installed SQL Server 2005 Enterprise Edition (with SP3) on a server running Windows Server 2003 Enterprise Editon SP2 with 8GB RAM and with "Physical Address Extension".
I want the SQL Server 2005 makes use of memory that is in excess of 4 GB and will perform the following steps to accomplish this:

1) I'll add the SQL service account to the
policy "lock his pages in memory"

2) I'll include the /PAE switch in Boot.ini

3) I'll change the "awe enabled" with the following commands:

sp_configure 'show advanced options', 1
sp_configure 'awe enabled', 1

4) I'll change "min server memory" and "max server memory" with the following commands:

sp_configure 'min server memory', 1024
sp_configure 'max server memory', 8192

SQL Server 2005 SP3 Applied and now a MATLAB unmanaged custom assembly is being unloaded



I've inherited a SQL Server 2005 database 9.00.4035.00 SP3 Standard Edition that has a stored procedure call a Matlab assembly.  We applied SP3 to this server. 32 Bit 8 GB RAM (2.33 GHZ x 8CPU)

and now we are getting unloads due to memory pressure.. I assume that SP3 is more rigorous in regards to UNSAFE items.

The unload Message in SQL Server error logs
AppDomain 2 (BEST.dbo[runtime].1) is marked for unload due to memory pressure.

We get this type of scenario.

A. Matlab takes space creating memory pressure.
B. REDGATE SQLBackup6 Log Backups fail (due also to CLR memory issues?)
C. Matlab gets unloaded
D. We cannot recreate the assembly as there is not enough space left.
E. We need to restart the SQL Server service to have enough space to rebuld the assembly. The Buffer pool is full

I'm a bit wary to set a -g startup parameter to the sqlservr.exe since we are in a clustering environment without a real way to test it thoroughly first.   i.e my failover cluster server for SQL server is a DEV/QA sql server instance until the failover occurs. (I did not architect this by the way).

So does anyone have any suggestions in regard to getting MatLab to function again under SP3? It ran fine albeit likely obtrusively and rough under SP2.  No-one was watching for unloads for unexplained s

System.out of memory exception in sql server 2005 repoting services



this is ram,

I am new to the reporting services,just one month back i joined in the company.there i got trained in ssrs 2005 .

nd my pblm is i inserted one of the csv file into the sql server 2005,it contains 102866 records,nd then i started generating summarized record through sql server 2005 reporting services.when i started generating the reports with few columns i didnt get any pblm,but when i started including more columns with aggregate functions i am getting the ecxeption called system out of memory exception.and by google search i found some solutions like enabling the AWE,but still i am getting the same exception

my server configuration is

64 bit windows server 2003,






.NET Framework execution was aborted by escalation policy because of out of memory



I have a SQL CLR used to read a XML file, it works fine when the file is smaller, but will give me this error if the file if bigger i.e. more than 10M.

Msg 6532, Level 16, State 49, Line 2

.NET Framework execution was aborted by escalation policy because of out of memory.

System.InvalidOperationException: Data access is not allowed in this context. Either the context is a function or method not marked with DataAccessKind.Read or SystemDataAccessKind.Read, is a callback to obtain data from FillRow method of a Table Valued Function, or is a UDT validation method.


at System.Data.SqlServer.Internal.ClrLevelContext.CheckSqlAccessReturnCode(SqlAccessApiReturnCode eRc)

at System.Data.SqlServer.Internal.ClrLevelContext.GetDatabase(SmiEventSink sink, Int32* pcbLen, IntPtr* ppwsName)

at Microsoft.SqlServer.Server.InProcConnection.GetCurrentDatabase(SmiEventSink eventSink)

at System.Data.SqlClient.SqlInternalConnectionSmi.Activate()

at System.Data.SqlClient.SqlConnectionFactory.GetContextConnection(

How to find out how memory is allocated in SQL Server 2005/2008?


I want to find out how to get memory information from SQL Server using DMVs that will equal to or be very close to the memory shown in Mem Usage column of Windows Task Manager for sqlservr.exe.   I have tried to sum single_pages_kb, multi_pages_kb, and virtual_memory_committed_kb from sys.dm_os_memory_clerks but the combined total is still less than the Mem Usage from Windows Task Manager.  

SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

Accessing SharePoint 2010 Data with Server-Side APIs

Accessing SharePoint data in server-side solutions is one of the most common tasks that you will perform as a SharePoint developer. SharePoint 2010 provides powerful server-side APIs that enable you to retrieve, add, edit, and delete SharePoint data programmatically. SharePoint 2010 also includes the new LINQ to SharePoint technology that enables you to work with SharePoint data efficiently and easily.

sql server 2000 vs 2005


i would like to ask what the difference between sql server 2000 and 2005 

How to save Unicode in SQL Server 2005

I am using google transliteration to display the text in Hindi/Tamil

I tried to store the text appear as Hindi from textarea in an nvarchar
field of database (SQL Server 2005) , the text saved as "???????".

After retireving text from the same it display the text as "???????".

Can anyone help me how to store and retrieve the actual data from SQL
Server 2005?

I am using ASP.net,VB.Net and SQL Server 2005

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

sql server 2005 enterprise edition is required


sql serve 2005 enterprise edition is required to work with microsoft enterprise blocks


need help: HTMLEditor, Sql-Server 2005 and CrystalReport


Hi All,
i use the Ajax Control Toolkit HTMLEditor in VS 2008 web-project and save the formated text/content in Sql-Server 2005 - it works fine!

Now, i want print the formated text in a Report, with CrystalReport...??? is this possible?

How do i handle the process? i thing, i see the forest based on all the trees not more...

Can anyone help me? how to do?


SQL Server 2005: Regular Expressions Make Pattern Matching And Data Extraction Easier


Now you can perform efficient, sophisticated text analysis using regular expressions in SQL Server 2005.

David Banister

MSDN Magazine February 2007

SQL Server 2005: Jazz Up Your Data Using Custom Report Items In SQL Server Reporting Services


Custom report items in SQL Server 2005 Reporting Services address your needs for custom reports without the pain of doing it from scratch.

Teo Lachev

MSDN Magazine October 2006

Use The Source, Luke: Source Server Helps You Kill Bugs Dead In Visual Studio 2005


The latest releases of WinDBG and Visual Studio know exactly how to use source server, so its benefits are available to both .NET and native C++ developers. See why this is so important in tracking down bugs.

John Robbins

MSDN Magazine August 2006

Data Points: Report Controls in SQL Server 2005 Reporting Services


Reporting has always been one of the dark arts of development. The tools typically seem to do just enough to get you to a certain point, then leave you to find workarounds to solve more complex issues.

John Papa

MSDN Magazine July 2006

Data Points: Designing Reports with SQL Server Reporting Services 2005


Many applications require some degree of integration with a reporting tool. A good solution, SQL ServerT Reporting Services 2005, provides Web-based reports and can be integrated into both Windows® Forms and Web-based applications.

John Papa

MSDN Magazine June 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend