从过去两天开始,我可以在 SQL Server 错误日志中看到以下内容。
AppDomain 2 (mssqlsystemresource.dbo[runtime].1) unloaded.
&
AppDomain 2 (mssqlsystemresource.dbo[runtime].1) is marked for unload due to memory pressure.
我有这样的系统环境:
OS- microosft windows server 2012 R2 Standard
processors - Intel(R) Xeon(R) CPU E5-2670 0 @2.60 GHz
Installed Memory (RAM) - 8GB
Hardware Information - VMWare, Inc. VMware Virtual Platform
SQL Server - Microsoft SQL Server Enterprise (64-bit)
我已经在本地服务器中签出了昨天的事件日志。我发现了这些事件
Server Name ID Severity Source Log Date and Time
ABC 1008 Error Microsoft-Windows-Perflib Application 10/01/2015 2:21
ABC 2 Error TeamCentral Application 9/30/2015 4:20:41 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 4:20:41 PM
ABC 10016 Error Microsoft-Windows-DistributedCOM System 9/30/2015 4:06:23 PM
ABC 10016 Error Microsoft-Windows-DistributedCOM System 9/30/2015 4:00:04 PM
ABC 10016 Error Microsoft-Windows-DistributedCOM System 9/30/2015 4:00:02 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:55:13 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:55:13 PM
ABC 10016 Error Microsoft-Windows-DistributedCOM System 9/30/2015 3:40:06 PM
ABC 10016 Error Microsoft-Windows-DistributedCOM System 9/30/2015 3:40:03 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:23:54 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:23:54 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:22:48 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:22:48 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:21:43 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:21:43 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:18:24 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:18:24 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:16:49 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:16:49 PM
ABC 1309 Warning ASP.NET 4.0.30319.0 Application 9/30/2015 3:15:43 PM
ABC 2 Error TeamCentral Application 9/30/2015 3:15:43 PM
ABC 1010 Error Microsoft-Windows-Perflib Application 9/30/2015 10:42:00 AM
在事件中,我收到了这样的消息:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 9/30/2015 4:20:41 PM
Event time (UTC): 9/30/2015 1:20:41 PM
Event ID: 72c24cb89beb4d7f80bec250aaa686e3
Event sequence: 757
Event occurrence: 17
Event detail code: 0
Application information:
Application domain: /XX/XXXX/1/ROOT/TeamCentral-2-130850431401577570
Trust level: Full
Application Virtual Path: /TeamCentral
Application Path: C:\XXXX\wwwroot\TeamCentral\
Machine name: ABC
Process information:
Process ID: 2180
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: HttpException
Exception message: The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at DevExpress.Web.ASPxClasses.Internal.HttpUtils.WriteFileToResponse(Page page, MemoryStream stream, String fileName, Boolean saveAsFile, String fileFormat, String contentType)
at DevExpress.Web.ASPxClasses.Internal.HttpUtils.WriteFileToResponse(Page page, MemoryStream stream, String fileName, Boolean saveAsFile, String fileFormat)
at DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteToResponse(String fileName, Boolean saveAsFile, String fileFormat, ExportToStream getStream, ExportOptionsBase options)
at DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxToResponse(String fileName, Boolean saveAsFile)
at DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxToResponse(String fileName)
at InfoArch.Web.Grid.ExportHelper.Response(ExportFileType fileType, Grid structure)
at InfoArch.Web.Grid.GridManager.SaveToXlsx(String filename)
at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Request information:
Request URL: http://ABC/TeamCentral/Reporting/GridView.aspx?layoutid=38&mf=report&where=&description=PZF6Q0PKJzWQDHkN08mydZNuJ3fZ(:#cd6TgCAL0hv4u4=&screenheight=618
Request path: /TeamCentral/Reporting/GridView.aspx
User host address:XXX.XXX.XX.XXX
User: rafeek
Is authenticated: True
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 190
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at DevExpress.Web.ASPxClasses.Internal.HttpUtils.WriteFileToResponse(Page page, MemoryStream stream, String fileName, Boolean saveAsFile, String fileFormat, String contentType)
at DevExpress.Web.ASPxClasses.Internal.HttpUtils.WriteFileToResponse(Page page, MemoryStream stream, String fileName, Boolean saveAsFile, String fileFormat)
at DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteToResponse(String fileName, Boolean saveAsFile, String fileFormat, ExportToStream getStream, ExportOptionsBase options)
at DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxToResponse(String fileName, Boolean saveAsFile)
at DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxToResponse(String fileName)
at InfoArch.Web.Grid.ExportHelper.Response(ExportFileType fileType, Grid structure)
at InfoArch.Web.Grid.GridManager.SaveToXlsx(String filename)
at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
在提出问题之前,我已经通过 Stackexchange,我发现 ref App 域由于内存压力而被标记为卸载,但从某些角度来看,无法理解事件日志消息。
的输出select @@version
;
Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) Oct 19 2012 13:38:57 版权所有 (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.2 (Build 9200:) (Hypervisor)
和输出 exec sp_configure
;
Name minimum maximum config_value run_value
max server memory (MB) 128 2147483647 2147483647 2147483647
任何建议将不胜感激。
在不打折@Shanky 的回答中陈述的任何内容的情况下,应该注意正在卸载的特定 AppDomain 位于
[mssqlsystemresource]
数据库中。这是一个存储内置 SQL Server 功能的内部数据库。其他内置功能驻留在[master]
数据库中。即使关闭了“CLR Enabled”的服务器级配置选项,如果您使用以下任何一种,您仍然可以看到这些 AppDomain 中的一个或两个正在加载(并且可能还有其他 CLR 的内部使用不在此列表):运行以下命令:
如果没有返回行,则运行以下命令:
现在您应该会看到“master.sys[runtime].xx”的条目(其中
xx
是某个数字),但仍然没有加载程序集。现在运行:您现在应该也看到一个加载的程序集。它应该是 assembly_id 1,这是所有数据库中的相同条目:
Microsoft.SqlServer.Types
. 如果您运行,此程序集会显示在所有数据库中SELECT * FROM sys.assemblies;
,但它只是真正存在于[master]
.首先,您将 SQL Server 2012 修补到 SP1。我会敦促您尽快使用SQL Server 2012 SP2修补 SQL Server
SQl Server 2012 Sp2 中有一些显着的内存相关修复。请阅读记录 OOM 错误修复的知识库文章之一。如果你仔细观察,修复也适用于
我并不是肯定地说您可能会遇到提到的错误,因为它需要更彻底的分析。
您确认在两天内您只看到此消息两次,这让我相信这没什么好担心的。有时,在加载和卸载 CLR 时,此类消息是良性的。当此消息频繁出现时,就会出现问题。这将需要更多的分析。
由于 VAS 限制,应用程序域消息在 32 位系统中曾经是真正的问题。在 64 位系统应用程序域卸载消息主要是由于损坏的 .NET Framework或您错误地设置了最大服务器内存值。但后来是这样,直到 SQL Server 2008 r2。从 2012 年开始,由于 CLR 的内存是从您设置的最大服务器内存分配的,因此这应该不是什么大问题。因此,我建议您还查看与 .NET Framework 相关的消息。我对如何进行 .NET 故障排除没有太多经验。
你使用 SQLCLR 对象吗?请参阅使用 SQLCLR 时记录的各种错误消息。Bob Dorr有一篇关于当您在 SQL Server 错误日志中看到大量此类消息时如何继续的博客。
和
我有一种预感,这与 .NET Framework 相关。