SQL Log : AppDomain unloaded

Our SQL server log is filled with this message:

  • AppDomain xx (DWH_TOOLKIT.dbo[runtime].xx) created.
  • AppDomain xx (DWH_TOOLKIT.dbo[runtime].xx) unloaded.
  • AppDomain xx (DWH_TOOLKIT.dbo[runtime].xx) is marked for unload due to memory pressure.

We are using a CLR procedure to store error messages in a table, file, event log or Microsoft Operations Manager, and i suspect that it is caused by this CLR procedure.

Does anyone have a clue on how to solve this, except for adding more memory, 64Gb should be enough!!

more ▼

asked Nov 19, 2009 at 10:12 AM in Default

Håkan Winther gravatar image

Håkan Winther
15.7k 35 37 48

Just found the same problem in the errorlogs of one of our servers.
Jun 30, 2010 at 02:53 AM ThomasRushton ♦
(comments are locked)
10|1200 characters needed characters left

3 answers: sort oldest

Take a look at a blog post that I wrote, it provides the solution to your exact issue.

SQL Server Memory Configuration: Determining MemToLeave requirements

If you then have further questions then by all means please ask.

more ▼

answered Nov 19, 2009 at 10:19 AM

John Sansom gravatar image

John Sansom
897 2

Thank you John! You solved my issue in 6 minutes.
Nov 19, 2009 at 10:31 AM Håkan Winther
Does it apply to 64 bit version also? I have seen other blog posts that indicates that MemToLeave is no issue in 64 bit.
Nov 19, 2009 at 10:51 AM Håkan Winther
So long as you set or rather limit the maximum memory setting of SQL Server to ensure that there is sufficient memory allocated outside of the SQL Server process space, then this should not be an issue for you. Take a look at the following post for an explanation as to why: http://sqlblogcasts.com/blogs/christian/archive/2008/01/07/sql-server-memtoleave-vas-and-64-bit.aspx
Nov 19, 2009 at 07:35 PM John Sansom
Good answer, good blog post! Thanks.
Jun 30, 2010 at 02:52 AM ThomasRushton ♦
Aug 13, 2012 at 06:36 AM eghetto
(comments are locked)
10|1200 characters needed characters left

The real question is what problem beyond these entries in the ErrorLog do you have? If you aren't getting failed_virtual_alloc problems, or other execution failures, then you probably shouldn't do anything about this. If your appdomain loads and isn't used often enough, just like everything else in SQL, it will eventually get unloaded. The -g startup parameter can be used to bump the VAS reservation in 32 bit servers, but that only goes so far to prevent the errors being logged. If the AppDomain isn't used frequently enough, it will still unload and you will still get log entries. This isn't a problem on 64 bit SQL Servers because there the VAS limit is 8TB for user mode VAS which is well beyond the physical memory limits currently available. You always have avaiable contiguous VAS on 64 bit servers so there is no VAS reservation or "MemToLeave" area. The engine doesn't even execute that block of code in 64 bit versions.

more ▼

answered Dec 06, 2009 at 01:19 AM

Jonathan Kehayias gravatar image

Jonathan Kehayias
283 1 1 2

(comments are locked)
10|1200 characters needed characters left

Is your issue solved? if not pls let me know, i can help. dbapayal@gmail.com

more ▼

answered Mar 03, 2010 at 05:34 PM

payal gravatar image


(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 19, 2009 at 10:12 AM

Seen: 10479 times

Last Updated: Aug 13, 2012 at 06:36 AM