资源池内存占用

Microsoft.SQLServer.Windows.Monitor.UserResourcePool.MemoryConsumption (UnitMonitor)

当资源池使用的内存量大于“阈值”设置(以占给定资源池的内存优化数据表可用的内存百分比表示)时,监视器将报告严重状态,并引发警报。

Knowledge Base article:

摘要

当资源池使用的内存量大于“阈值”设置(以占给定资源池的内存优化数据表可用的内存百分比表示)时,监视器将报告严重状态,并引发警报。

映射到拥有内存优化表的数据库时,指定的资源池将跟踪分配给所有内存优化表(包括用于内存优化数据引擎中不同结构的内部表)的内存。

原因

与 SQL Server 相比,SQL Server 内存优化数据使用的内存更多,方式也不一样。为内存优化数据安装和分配的内存量可能无法满足日益增长的需要。如果是这样,内存可能会用尽。

有关详细信息,请参阅本文: Bind a Database with Memory-Optimized Tables to a Resource Pool(将具有内存优化表的数据库绑定至资源池)。

解决方法

要解决“低内存”或“内存不足”的问题,你需要通过减少使用率来释放现有内存,或为内存优化数据表提供更多可用内存。可能的更正操作包括:

外部

如何管理内存优化数据的内存

可替代参数

名称

说明

默认值

警报优先级

定义警报优先级。

正常

警报严重性

定义警报严重性。

错误

已启用

启用或禁用工作流。

生成警报

定义工作流是否生成警报。

间隔(秒)

运行工作流的重复间隔时间(秒)。

900

样本数

指示在状态发生更改之前测量值应违反阈值的次数。

6

同步时间

使用 24 小时格式指定的同步时间。可以忽略。

 

阈值

收集的值将与此参数进行比较。

90

超时(秒)

指定工作流在关闭之前允许运行的时间,并标记为失败。

300

数据库连接超时(秒)

如果在指定期间无法访问数据库,工作流将失败并注册一个事件。

15

Element properties:

TargetMicrosoft.SQLServer.Windows.UserResourcePool
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Windows.MonitorType.UserResourcePool.MemoryConsumption
RemotableTrue
AccessibilityPublic
Alert Message
Windows 上的 MSSQL: 内存优化数据: 资源池使用的内存过多。
资源池“{0}”使用的内存过多。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.UserResourcePool.MemoryConsumption" Target="SqlDiscW!Microsoft.SQLServer.Windows.UserResourcePool" ParentMonitorID="Health!System.Health.PerformanceState" TypeID="Microsoft.SQLServer.Windows.MonitorType.UserResourcePool.MemoryConsumption" Accessibility="Public" Enabled="true" Remotable="true" Priority="Normal" ConfirmDelivery="true">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.UserResourcePool.MemoryConsumption.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.ResourcePool"]/Name$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ErrorState" MonitorTypeStateID="ErrorState" HealthState="Error"/>
<OperationalState ID="SuccessState" MonitorTypeStateID="SuccessState" HealthState="Success"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<MonitoringType>$Target/Host/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
<SqlExecTimeoutSeconds>60</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<Threshold>90</Threshold>
<NumSamples>6</NumSamples>
<PoolName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.ResourcePool"]/Name$</PoolName>
</Configuration>
</UnitMonitor>