資源集區記憶體消耗

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

資源集區所使用的記憶體量大於臨界值設定 (以指定的資源集區記憶體內資料表的可用記憶體百分比表示) 時,此監視器會回報重大狀態,並引發警示。

Knowledge Base article:

摘要

資源集區所使用的記憶體量大於臨界值設定 (以指定的資源集區記憶體內資料表的可用記憶體百分比表示) 時,此監視器會回報重大狀態,並引發警示。

對應至記憶體最佳化資料庫的具名資源集區,會追蹤配置給所有記憶體最佳化資料表的記憶體,包括用於記憶體內 OLTP 引擎內各種結構的內部資料表。

原因

SQL Server 記憶體內 OLTP 所使用的記憶體比 SQL Server 多,而且方法也與它不同。為記憶體內 OLTP 所安裝及配置的記憶體數量,可能變得無法滿足成長需求。如果是這樣,可能會用盡記憶體。

如需詳細資訊,請參閱本文: 將含記憶體最佳化資料表的資料庫繫結至資源集區

解決方式

為解決記憶體太低或記憶體不足的情況,您需要透過降低使用率來釋出現有記憶體,或提供更多記憶體給記憶體內資料表使用。可能的更正動作包括:

外部資源

如何管理記憶體內 OLTP 的記憶體

可覆寫的參數

名稱

描述

預設值

已啟用

 

產生警示

 

間隔 (秒)

執行工作流程的週期性時間間隔 (秒)。

900

指令碼延遲 (毫秒)

此參數可設定工作流程所執行的連續 T-SQL 查詢之間的延遲。這可能有助於減少工作流程在有大量目標物件時,所產生的磁碟使用量。請先取得 Microsoft 支援服務的建議,再變更此參數。

0

同步處理時間

使用 24 小時制指定的同步處理時間。將會忽略。

 

臨界值

收集的值會與此參數相比。

90

逾時 (秒)

指定允許工作流程在關閉且標示為失敗之前執行的時間。

300

Element properties:

TargetMicrosoft.SQLServer.2014.UserResourcePool
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2014.MonitorType.UserResourcePool.MemoryConsumption
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL 2014: 記憶體內 OLTP: 資源集區使用太多記憶體。
資源集區 "{0}" 使用太多記憶體。
伺服器上的實體記憶體總計: {6} MB
SQL 執行個體的目標記憶體: {1} MB
集區記憶體: {2} MB
記憶體內資料表可用: {3} MB ({4} \%)
目前已使用: {5} MB
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2014.Monitor.UserResourcePool.MemoryConsumption" Target="SQL2014Core!Microsoft.SQLServer.2014.UserResourcePool" ParentMonitorID="SystemHealth!System.Health.PerformanceState" TypeID="Microsoft.SQLServer.2014.MonitorType.UserResourcePool.MemoryConsumption" Accessibility="Public" Enabled="true" Remotable="true" Priority="Normal" ConfirmDelivery="true">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2014.Monitor.UserResourcePool.MemoryConsumption.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.ResourcePool"]/Name$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='MemoryForSQLInstanceMB']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='PoolAvailableMemoryMB']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='PoolFreeMemoryMB']$</AlertParameter4>
<AlertParameter5>$Data/Context/Property[@Name='PoolFreeMemoryPercent']$</AlertParameter5>
<AlertParameter6>$Data/Context/Property[@Name='PoolUsedMemoryMB']$</AlertParameter6>
<AlertParameter7>$Data/Context/Property[@Name='TotalMemoryOnTheServerMB']$</AlertParameter7>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ErrorState" MonitorTypeStateID="ErrorState" HealthState="Error"/>
<OperationalState ID="SuccessState" MonitorTypeStateID="SuccessState" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<ServerName>$Target/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ServerName>
<SqlInstanceName>$Target/Host/Host/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.ServerRole"]/InstanceName$</SqlInstanceName>
<Value>Property[@Name='PoolUsedMemoryPercent']</Value>
<PoolID>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.ResourcePool"]/PoolID$</PoolID>
<Threshold>90</Threshold>
<TimeoutSeconds>300</TimeoutSeconds>
<ScriptDelayMsec>0</ScriptDelayMsec>
</Configuration>
</UnitMonitor>