| title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords |
|---|---|---|---|---|---|---|---|---|---|
|
MSSQLSERVER_17890 |
MSSQLSERVER_17890 |
suresh-kandoth |
sureshka |
vencher, tejasaks, docast |
12/25/2020 |
sql |
supportability |
reference |
17890 (Database Engine error) |
MSSQLSERVER_17890
[!INCLUDE SQL Server]
Details
| Attribute | Value |
|---|---|
| Product Name | SQL Server |
| Event ID | 17890 |
| Event Source | MSSQLSERVER |
| Component | SQLEngine |
| Symbolic Name | SRV_WS_TRIMMED |
| Message Text | A significant part of SQL Server process memory has been paged out. This may result in a performance degradation. Duration: %d seconds. Working set (KB): %I64d, committed (KB): %I64d, memory utilization: %d%%. |
Explanation
You might encounter the following error message in the [!INCLUDEssNoVersion] error log or the Windows Application event log.
A significant part of SQL Server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 3383250, committed (KB): 9112480, memory utilization: 37%.
You might also notice a sudden performance degradation with query execution and all other operations on the SQL Server.
Cause
[!INCLUDEssNoVersion] monitors the various memories related information about the [!INCLUDEssNoVersion] process. In this case, it has detected that the working set of the process is less than 50% of the committed process memory. As a result this warning is printed. The normal causes of this warning are:
- The operating system pages out large portions of the [!INCLUDEssNoVersion] committed memory to the paging file.
- This could be due to sudden increased demand for memory from other applications or operating system needs.
- This could also happen when certain device drivers request contiguous memory allocations for their needs.
User action
You can prevent the Windows operating system from paging out the buffer pool memory of the [!INCLUDEssNoVersion] process by locking the memory that is allocated for the buffer pool in physical memory. You lock the memory by assigning the Lock pages in memory user right to the user account that is used as the startup account of the [!INCLUDEssNoVersion] service. But before you implement this solution, review the sections What causes SQL Server memory to be paged out and Important considerations before you assign the «Lock pages in memory» user right for an instance of SQL Server
[!NOTE]
Using Lock Pages in Memory ensure that the memory managed by [!INCLUDEssNoVersion] is not paged out. However, thread stacks, the EXE and any DLL images, heap memory, CLR memory can still be paged out by the OS.Starting with [!INCLUDEssNoVersion] 2008 SP1 Cumulative Update 2, both [!INCLUDEssNoVersion] Standard and Enterprise editions can use the Lock pages in memory user right. For more information about support for locked pages, view KB970070 — Support for Locked Pages on SQL Server Standard Edition (64-bit) systems.
To assign the Lock pages in memory user right, follow these steps:
- Click Start, click Run, type gpedit.msc, and then click OK.
- Note The Group Policy dialog box appears.
- Expand Computer Configuration, and then expand Windows Settings.
- Expand Security Settings, and then expand Local Policies.
- Click User Rights Assignment, and then double-click Lock pages in memory.
- In the Local Security Policy Setting dialog box, click Add User or Group.
- In the Select Users or Groups dialog box, add the account that has permission to run the Sqlservr.exe file, and then click OK.
- Close the Group Policy dialog box.
- Restart the [!INCLUDEssNoVersion] service.
After you assign the Lock pages in memory user right and you restart the [!INCLUDEssNoVersion] service, the Windows operating system no longer pages out the buffer pool memory within the [!INCLUDEssNoVersion] process. However, the Windows operating system can still page out the nonbuffer pool memory within the [!INCLUDEssNoVersion] process.
You can validate that the user right is used by the instance of [!INCLUDEssNoVersion] by making sure that the following message is written in the [!INCLUDEssNoVersion] Error Log at startup: «Using locked pages for buffer pool»
This message applies only to SQL Server. For more information about this message in the ERRORLOG, visit the following:
Do I have to assign the Lock pages for Memory privilege in Local System
When the Windows operating system pages out the nonbuffer pool memory, you may still encounter performance issues. However, the error messages that are mentioned in the «Explanation» section are not logged in the [!INCLUDEssNoVersion] error log.
What causes SQL Server memory to be paged out
There are three broad categories of problems that can cause this issue:
- Application-Related Issues: All applications together have exhausted the available physical memory and the OS must free some memory for new application requests for resources. Typically, the approach here is to find what applications are exhausting the memory and take necessary steps to balance the memory among them without leading to RAM exhaustion.
- Device Driver Issues: Device Drivers may cause working set paging of all processes if the driver calls a memory allocation function incorrectly.
- Operation System Issues
Below, you can find information on each of these categories
-
Application-Related issues: Applications together may consume all of the RAM on the system. If new requests for memory are made, the OS attempts to satisfy them and if there is no free memory, it will trim the working set of running applications to satisfy the memory requests. In such cases, you may observe that the working set for most if not all applications drop significantly. To observe this, collect the following Performance Monitor counter for all applications on the system:
- Performance object: Process
- Counter: Working Set
Also, monitor the following counter to correlate how much physical memory is available on the system.
- Performance object: Memory
- Counter: Available Memory (MB)
The typical behavior that you may observe is reduction of Available memory close to 0 MB while at the same time a sudden drop of the Working Set counters for most (all) processes on the system. If you observe such behavior, you may need to take steps to reduce memory usage on the system, which includes for example reducing Max Server Memory for SQL Server.
Applications may also use the system cache too much, and may cause a large growth of the system cache. To respond to the growth of the system cache, the system pages out the working set of the [!INCLUDEssNoVersion] process or of other applications. If you experience this problem, you can use some memory management functions in the application. These functions control the system cache space that file I/O operations can use in the application. For example, you can use the SetSystemFileCacheSize function and the GetSystemFileCacheSize function to control the system cache space that file I/O operations can use.
You can use the Memory performance object to view the values of various counters in this object to determine whether the system cache working set uses too much memory. For example, you can view the Cache Bytes and System Cache Resident Bytes counters. For more information about this topic, see:
- Too Much Cache
- Microsoft Windows Dynamic Cache Service
- You experience performance issues in applications and services when the system file cache consumes most of the physical RAM
You can download and deploy the «Microsoft Windows Dynamic Cache Service» to control the memory that is consumed by the system cache.
-
Device Driver Issues: If a device driver uses the
MmAllocateContiguousMemoryfunction, and if it sets the value of the HighestAcceptableAddress parameter to less than 4 gigabytes (GB), the Windows operating system may page out the working set of the processes on the system including [!INCLUDEssNoVersion] process. To resolve this problem, contact the vendor of the device driver for driver updates.When a device driver tries to allocate memory, the Windows operating system may page out the working set of other applications. This Windows hotfix lets you use event tracing to find the device driver that causes problem. To find more information about the specific driver that causes the working set trimming behavior, see Identifying Drivers That Allocate Contiguous Memory.
-
Operating System Issues: To resolve the known issues that cause the Windows operating system to page out the working set of the [!INCLUDEssNoVersion] process, apply the hotfixes that are described in the following Microsoft Knowledge Base articles.
[!NOTE]
Hotfixes are cumulative. A later version of a hotfix contains the earlier versions of that hotfix.-
The [!INCLUDEssNoVersion] set may be trimmed when the system is using some advanced TCP features. For more information, see How to troubleshoot advanced network performance features such as RSS and NetDMA.
-
If you are running [!INCLUDEssNoVersion] on Windows Server 2008, you must apply fixes for known issues that can lead to working set trimming or unnecessary excessive memory consumption by other operating system components. For more information, review the following articles
The report generation process may stop responding when you run Perfmon.exe with the Active Directory Diagnostics template to generate a report on a Windows Server 2008-based domain controller. -
If you are running [!INCLUDEssNoVersion] on Windows Serve 2008 R2, you must apply fixes for known issues that can lead to working set trimming. For more information review the following articles:
- A computer that is running Windows 7 or Windows Server 2008 R2 becomes unresponsive when you run a large application
- Poor performance occurs on a computer that has NUMA-based processors and that is running Windows Server 2008 R2 or Windows 7 if a thread requests lots of memory that is within the first 4 GB of memory
- Computer intermittently performs poorly or stops responding when the Storport driver is used in Windows Server 2008 R2
-
Important considerations before you assign the «Lock pages in memory» user right
You should make additional considerations before you assign the Lock pages in memory user right. If you assign this user right on systems that are configured incorrectly, the system may become unstable or experience a performance decrease of the whole system. Additionally, event ID 333 may be logged in the event log.
If you contact Microsoft Customer Support Service (CSS) for these problems, CSS engineers may ask you to revoke this user right for the user account that is used as the startup account of the [!INCLUDEssNoVersion] service. This step may be necessary to collect important performance data that CSS engineers can use for necessary configuration of the various options for [!INCLUDEssNoVersion] and for other applications that are running on the system. After CSS engineers collect the performance data, you can assign the Lock pages in memory user right to the startup account of the [!INCLUDEssNoVersion] service.
Before you assign the Lock pages in memory user right, make sure that you capture a Performance Monitor log to determine the memory requirements of various applications and services that are installed on the system. These applications also include SQL Server. To determine the memory requirements, collect the following baseline information:
-
Make sure that you set the max server memory option and the min server memory option correctly. These options reflect only the memory requirement of the buffer pool of the [!INCLUDEssNoVersion] process. These options do not include the memory that is allocated for other components within the [!INCLUDEssNoVersion] process. These components include the following:
- The [!INCLUDEssNoVersion] worker threads
- Various DLLs and components that the [!INCLUDEssNoVersion] process loads within the address space of the [!INCLUDEssNoVersion] process
- The Backup and restore operations
-
The DLLs and components include various OLE DB providers, extended stored procedures, Microsoft COM objects that are used for the sp_OACreate stored procedure, linked servers, and [!INCLUDEssNoVersion] CLR. Memory that is allocated for these components falls under the nonbuffer pool region of the address space of the [!INCLUDEssNoVersion] process. To ideally determine the maximum amount of memory that the whole [!INCLUDEssNoVersion] process can use, you must subtract the memory that is allocated for components that do not use the buffer pool from the total memory that you want the [!INCLUDEssNoVersion] process to use. Then, you can use the remainder value to set the max server memory option. Before you set the max server memory option and the min server memory option, you should carefully review the «Setting the memory options manually» topic in [!INCLUDEssNoVersion] Books Online.
-
Determine the memory requirement of other applications and of the Windows operating system components. Applications may include other [!INCLUDEssNoVersion] components, for example, [!INCLUDEssNoVersion] Agent, [!INCLUDEssNoVersion] Replication Agents, [!INCLUDEssNoVersion] Reporting Services, [!INCLUDEssNoVersion] Analysis Services, [!INCLUDEssNoVersion] Integration Services, and [!INCLUDEssNoVersion] Full Text Search. Applications that perform Backup operations and file copy operations may use lots of memories. Consider operations such as bulk copy and the Snapshot Agent that generate file IO. You must consider the memory requirement of all these applications when you determine the value of the max server memory option and of the min server memory option. You can use the Private Bytes counter and the Working Set counter under the Process object for every process to determine the memory requirement for a specific process.
-
By default, the Lock pages in memory user right have already been assigned to the built-in Local System account. For more information, visit the following Microsoft Web site:
Do I have to assign the Lock pages in Memory privilege for Local system? -
If you use a Windows user account globally for all [!INCLUDEssNoVersion] processes in a domain, determine the user rights that are assigned by using a Group Policy configuration. A 32-bit [!INCLUDEssNoVersion] process may use this account as the startup account. However, this account requires the Lock pages in memory user right to enable the
Address Windowing Extensions(AWE) feature. For more information, see the «Providing the maximum amount of memory to SQL Server» topic in [!INCLUDEssNoVersion] Books Online. -
Before you configure the max server memory option and the min server memory option for multiple [!INCLUDEssNoVersion] instances, consider the memory requirements of the nonbuffer pool for each instance of SQL Server. Then, configure these options for each instance of SQL Server.
Ideally, you collect this baseline information during peak loads. Therefore, you can determine the memory requirements for various applications and components to support the peak load. The memory requirements vary from one system to another system, depending on the activities and the applications that are running on the system. You can query the information that is provided in the dynamic management view sys.dm_os_process_memory to understand whether the system is encountering low memory conditions. For more information, see sys.dm_os_process_memory (Transact-SQL).
Improvements added in Windows Server 2008 and R2 version
Windows Server 2008 and Windows Server 2008 R2 improve the contiguous memory allocation mechanism. This improvement lets Windows Server 2008 and Windows Server 2008 R2 reduce to a certain extent the effects of paging out the working set of applications when new memory requests arrive.
The following is an explanation of the improvements from the Microsoft whitepaper «Advances in Memory Management in Windows»:
In Windows Server 2008, the allocation of physically contiguous memory is greatly enhanced. Requests to allocate contiguous memory are much more likely to succeed because the memory manager now dynamically replaces pages, typically without trimming the working set or performing I/O operations. In addition, many more types of pages—such as kernel stacks and file system metadata pages, among others—are now candidates for replacement. Consequently, more contiguous memory is generally available at any given time. In addition, the cost to obtain such allocations is greatly reduced.
For more information, view SQL Server Working Set Trim Problems.
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.
- Remove From My Forums
-
Question
-
Hi,
I am suddenly facing this issue in my development server and got the following message in logs:
A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 4448, committed (KB): 558008, memory utilization: 0%%.
The overall memory consumption of windows is itself 3.66GB out of 16GB. ALso in the above message the memory utilization is 0%. How can this cause memory pressure for windows. CAn any one help in getting is fixed?
-
Moved by
Friday, October 10, 2014 4:27 PM
-
Moved by
Answers
-
-
Proposed as answer by
Qiuyun YuMicrosoft contingent staff
Saturday, October 11, 2014 9:15 AM -
Marked as answer by
Lydia ZhangMicrosoft contingent staff
Monday, October 20, 2014 1:44 AM
-
Proposed as answer by
-
I think you are mistaken. This message is basically because someother process has eaten up memory and OS has to trim SQL Server memory from RAM to page file.
Check if there is any other process which is eating up all the memory.
Also check if you have set max server memory after considering all other processes/softwares which need memory. Setting Lock pages in memory can help to an extent.
The link which URI mentioned cleanly explains this.
As per the error message the total memory allocated itself is just 550+mb which means there is someother process which has eaten up all the memory.
http://support2.microsoft.com/kb/2028324/ko
Which version of SQL and OS do you use. There are some known issues with earlier versions. Eg —
http://support2.microsoft.com/kb/905865/en-us
Regards, Ashwin Menon My Blog — http:\sqllearnings.com
-
Proposed as answer by
Qiuyun YuMicrosoft contingent staff
Saturday, October 11, 2014 9:23 AM -
Marked as answer by
Lydia ZhangMicrosoft contingent staff
Monday, October 20, 2014 1:44 AM
-
Proposed as answer by
-
Hi,
I am suddenly facing this issue in my development server and got the following message in logs:
A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 4448, committed (KB): 558008, memory utilization: 0%%.
The overall memory consumption of windows is itself 3.66GB out of 16GB. ALso in the above message the memory utilization is 0%. How can this cause memory pressure for windows. CAn any one help in getting is fixed?
This IMO is clear case of working set trimming.
What is version and edition of SQL server ? Is it SQL Server 2005 on windows server 2003 ?
What is total RAM on system ? How much is assigned to SQL Server ?
Are there any other services SSIS/SSAS/SSRS running ? are there any third party monitoring tools also running.
What does below return
select (physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB, (locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB, (total_virtual_address_space_kb/1024 )Total_VAS_in_MB, process_physical_memory_low, process_virtual_memory_low from sys. dm_os_process_memory
I am sure SQL Server service account does not have
Locked pages in memory privilege(LPIM). You can subside issue by giving LPIM to SQL Service account. But this is just workaround you would have to find process actually forcing SQL Server to trim memory. See how to troubleshoot section in link given by
Uri to resolve issue
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP-
Edited by
Shanky_621MVP
Friday, October 10, 2014 9:07 AM -
Proposed as answer by
Qiuyun YuMicrosoft contingent staff
Saturday, October 11, 2014 9:23 AM -
Marked as answer by
Lydia ZhangMicrosoft contingent staff
Monday, October 20, 2014 1:44 AM
-
Edited by
-
Hi Shankar,
You mean to say that this query
SELECT object_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = ‘Total Server Memory (KB)’;will not give the total memory used by SQL server? because this query gave 1.8GB and the memory used by SQL server was 2GB in task manager. I assumed this gave the exact number.
First its Shanky not Shankar :).
As per my experience Total Server Memory counter does not capture accurate value for memory utilized by SQL Server although definition is current memory used by SQL server, that is why I asked you to refer to DMV.
Again why are you looking at task manager in any case whether SQL server have or do not have LPIM please use DMV to get SQL Server memory utilization.
>>Can you please explain the advantage of LPIM?The max server memory config value is default value only which is 5120MB.
LPIM has a advantage. Consider a scenario where SQL Server is working fine and some rouge driver, Third part tool or too much remote desktop starts taking memory may be too much memory so that OS finds memory crunch, it would ask SQL Server to trim its memory
consumption. SQL Server will listen to and start trimming but sometimes memory pressure on OS can be so severe that before SQL Server reacts OS has to page SQL Server processes to disk and unfortunately making SQL Server very slow. So here culprit was some
bad process running on OS and SQL Server became victim. To avoid this LPIM is required when LPIM is there the memory allocated through AWE API or
Locked memory cannot be paged out to disk. Although its just masking the problem not solving it. Solving would involve removing those rouge drivers and giving sufficient memory to OS. There was bug in
Windows Server 2003 AND
Windows Server 2008 to excessively trim SQL Server memory consumption which makes it even more needful( Both bugs are fixed ).Jonathan has explained more
why LPIM is required.Out of 16 G giving only 5 G to SQL Server would cause memory crunch for SQL Server. Please use this link to set appropriate value for max server memory
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP-
Edited by
Shanky_621MVP
Tuesday, October 14, 2014 9:37 AM -
Proposed as answer by
Qiuyun YuMicrosoft contingent staff
Thursday, October 16, 2014 3:11 PM -
Marked as answer by
Lydia ZhangMicrosoft contingent staff
Monday, October 20, 2014 1:45 AM
-
Edited by
When you get “A significant part of SQL Server process memory has been paged out. This may result in performance degradation.This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 2007640, committed (KB): 4594040, memory utilization: 43%.” message in SQL Server error log
Pay attention to Working set (KB), committed (KB) and memory utilization:% (Percentage of SQL Server memory in RAM) in above warning message. Above warning message is logged in SQL Server error log when working set reaches 50% or below of the overall committed memory by SQL Server memory manager.
What is working set: Memory allocated by the process which is currently in RAM.
Committed: Total memory that is allocated by process (allocated bytes can be in RAM or Page file)
Working Set trimming: Windows is moving the allocated bytes of the process from physical RAM to page file because of memory pressure. Memory pressure is most commonly caused by applications or windows components that are requesting more memory causing OS to start trimming working set of other processes to satisfy these new requests.
Before we step in to troubleshooting working set trimming warnings, here are few basics about how SQL Server memory management is designed to dynamically adjust the committed memory based on the amount of available memory on the system.
SQL Server uses CreateMemoryResourceNotification to create a memory resource notification object and SQL Server Resource monitor threads calls QueryMemoryResourceNotification every time it runs to identify if there is any notification. If a low memory notification comes from Windows, SQL Server scales down its memory usage and when Windows sends the high memory notification, SQL Server Server can grow its memory usage target. Low memory notification is signaled by windows when the available physical memory drops approximately below 32 MB per 4 GB, to a maximum of 64 MB. The default level that signals a high-memory-resource notification event is three times the default low-memory value. As soon as the SQL Server resource monitor threads finds low-memory-resource notification it scales down SQL Server memory usage.
Why do I see “A significant part of sql server process memory has been paged out. This may result in performance degradation.” By SQL Server In spite of having above mechanism to detect the system level memory pressure and scale SQL Server memory?
There are couple of situations where SQL Server Process working set might be paged out by Windows despite these memory resource notification mechanism.
1.If windows is not sending the correct notifications to all listening processes at the right moment and thresholds
2.If SQL Server is not responding fast enough to the low memory resource notification from Windows
3.When low physical memory notification is received by SQL Server it will scale down its memory usage by trimming internal caches. This effect is applied for 5 seconds and then paused for 1 minute. This is to avoid any hungry/faulty application to consume all the memory making SQL Server to scale its usage continuously. If low memory conditions still exist after 1 minute pause, the effect is applied again. So if there is physical memory pressure even after SQL Server scaling its usage for 5 seconds windows will still page out SQL Server’s working set.
4.Conditions in Windows where working sets of all processes are trimmed
5.Windows might decide to trim a certain percentage of working set of various or specific processes
We can also increase the LowMemoryThreshold value so the OS will notify applications such as SQL on low memory conditions much earlier and SQL Server can respond to memory pressure much early before the system is starving for memory.
How to set the LowMemoryThreshold value (in MB)?
In Regedit -> go to
HKEY_LOCAL_MACHINESystemCurrentControlSetControlSessionManagerMemoryManagement
Right click on the right pane,
Select New -> select click DWORD Value -> enter LowMemoryThreshold
Double Click LowMemoryThreshold -> value (choose decimal) -> 512
System Reboot is required to take effect.
Default values as per MSDN:
“The default level of available memory that signals a low-memory-resource notification event is approximately 32 MB per 4 GB, to a maximum of 64 MB. The default level that signals a high-memory-resource notification event is three times the default low-memory value.”
We can use the below query to extract information about the condition of OS memory and SQL memory using a query like the following. Looking at this query, you will be able to easily determine the various indicators that would have triggered the Windows to page various processes including SQL Server. Use the following query to obtain the memory notification-related information from the XML data of the ring buffer
SELECT CONVERT (varchar(30), GETDATE(), 121) as [RunTime],
dateadd (ms, (rbf.[timestamp] - tme.ms_ticks), GETDATE()) as [Notification_Time],
cast(record as xml).value('(//Record/ResourceMonitor/Notification)[1]', 'varchar(30)') AS [Notification_type],
cast(record as xml).value('(//Record/MemoryRecord/MemoryUtilization)[1]', 'bigint') AS [MemoryUtilization %],
cast(record as xml).value('(//Record/MemoryNode/@id)[1]', 'bigint') AS [Node Id],
cast(record as xml).value('(//Record/ResourceMonitor/IndicatorsProcess)[1]', 'int') AS [Process_Indicator],
cast(record as xml).value('(//Record/ResourceMonitor/IndicatorsSystem)[1]', 'int') AS [System_Indicator],
cast(record as xml).value('(//Record/ResourceMonitor/Effect/@type)[1]', 'varchar(30)') AS [type],
cast(record as xml).value('(//Record/ResourceMonitor/Effect/@state)[1]', 'varchar(30)') AS [state],
cast(record as xml).value('(//Record/ResourceMonitor/Effect/@reversed)[1]', 'int') AS [reserved],
cast(record as xml).value('(//Record/ResourceMonitor/Effect)[1]', 'bigint') AS [Effect],
cast(record as xml).value('(//Record/ResourceMonitor/Effect[2]/@type)[1]', 'varchar(30)') AS [type],
cast(record as xml).value('(//Record/ResourceMonitor/Effect[2]/@state)[1]', 'varchar(30)') AS [state],
cast(record as xml).value('(//Record/ResourceMonitor/Effect[2]/@reversed)[1]', 'int') AS [reserved],
cast(record as xml).value('(//Record/ResourceMonitor/Effect)[2]', 'bigint') AS [Effect],
cast(record as xml).value('(//Record/ResourceMonitor/Effect[3]/@type)[1]', 'varchar(30)') AS [type],
cast(record as xml).value('(//Record/ResourceMonitor/Effect[3]/@state)[1]', 'varchar(30)') AS [state],
cast(record as xml).value('(//Record/ResourceMonitor/Effect[3]/@reversed)[1]', 'int') AS [reserved],
cast(record as xml).value('(//Record/ResourceMonitor/Effect)[3]', 'bigint') AS [Effect],
cast(record as xml).value('(//Record/MemoryNode/ReservedMemory)[1]', 'bigint') AS [SQL_ReservedMemory_KB],
cast(record as xml).value('(//Record/MemoryNode/CommittedMemory)[1]', 'bigint') AS [SQL_CommittedMemory_KB],
cast(record as xml).value('(//Record/MemoryNode/AWEMemory)[1]', 'bigint') AS [SQL_AWEMemory],
cast(record as xml).value('(//Record/MemoryNode/SinglePagesMemory)[1]', 'bigint') AS [SinglePagesMemory],
cast(record as xml).value('(//Record/MemoryNode/MultiplePagesMemory)[1]', 'bigint') AS [MultiplePagesMemory],
cast(record as xml).value('(//Record/MemoryRecord/TotalPhysicalMemory)[1]', 'bigint') AS [TotalPhysicalMemory_KB],
cast(record as xml).value('(//Record/MemoryRecord/AvailablePhysicalMemory)[1]', 'bigint') AS [AvailablePhysicalMemory_KB],
cast(record as xml).value('(//Record/MemoryRecord/TotalPageFile)[1]', 'bigint') AS [TotalPageFile_KB],
cast(record as xml).value('(//Record/MemoryRecord/AvailablePageFile)[1]', 'bigint') AS [AvailablePageFile_KB],
cast(record as xml).value('(//Record/MemoryRecord/TotalVirtualAddressSpace)[1]', 'bigint') AS [TotalVirtualAddressSpace_KB],
cast(record as xml).value('(//Record/MemoryRecord/AvailableVirtualAddressSpace)[1]', 'bigint') AS [AvailableVirtualAddressSpace_KB],
cast(record as xml).value('(//Record/@id)[1]', 'bigint') AS [Record Id],
cast(record as xml).value('(//Record/@type)[1]', 'varchar(30)') AS [Type],
cast(record as xml).value('(//Record/@time)[1]', 'bigint') AS [Record Time],
tme.ms_ticks as [Current Time]
FROM sys.dm_os_ring_buffers rbf
cross join sys.dm_os_sys_info tme
where rbf.ring_buffer_type = 'RING_BUFFER_RESOURCE_MONITOR' --and cast(record as xml).value('(//Record/ResourceMonitor/Notification)[1]', 'varchar(30)') = 'RESOURCE_MEMPHYSICAL_LOW'
ORDER BY rbf.timestamp ASC
We can use below query to to check the health of SQL Server including SQL Server working set information in past
SELECT CONVERT (varchar(30), GETDATE(), 121) as runtime, DATEADD (ms, a.[Record Time] - sys.ms_ticks, GETDATE()) AS Notification_time, a.* , sys.ms_ticks AS [Current Time]
FROM (SELECT x.value('(//Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS [ProcessUtilization],
x.value('(//Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS [SystemIdle %],
x.value('(//Record/SchedulerMonitorEvent/SystemHealth/UserModeTime) [1]', 'bigint') AS [UserModeTime],
x.value('(//Record/SchedulerMonitorEvent/SystemHealth/KernelModeTime) [1]', 'bigint') AS [KernelModeTime],
x.value('(//Record/SchedulerMonitorEvent/SystemHealth/PageFaults) [1]', 'bigint') AS [PageFaults],
x.value('(//Record/SchedulerMonitorEvent/SystemHealth/WorkingSetDelta) [1]', 'bigint')/1024 AS [WorkingSetDelta],
x.value('(//Record/SchedulerMonitorEvent/SystemHealth/MemoryUtilization) [1]', 'bigint') AS [MemoryUtilization (%workingset)],
x.value('(//Record/@time)[1]', 'bigint') AS [Record Time] FROM (SELECT CAST (record as xml) FROM sys.dm_os_ring_buffers
WHERE ring_buffer_type = 'RING_BUFFER_SCHEDULER_MONITOR') AS R(x)) a CROSS JOIN sys.dm_os_sys_info sys ORDER BY DATEADD (ms, a.[Record Time] - sys.ms_ticks, GETDATE())
- Process Utilization shows the percentage of overall used system CPU time that was consumed by sqlservr.exe. Process Utilization is calculated as sql_process_cpu_time/total_system_cpu_time for the current time interval.
- SystemIdle is the percentage of time that the system’s CPU’s have been idle.
- Page Faults value is the number of hard + soft page faults that have occurred since the last snapshot.
- Working Set is the change in the working set size in KB, since the last snapshot.
- Memory Utilization is working set/committed memory which is another way of saying that the number is the percentage of the process’ committed memory that is in RAM. The farther below 100% that this number falls, the larger the percentage of SQL memory that has been trimmed and moved to the page file.
Common Side Effects of Working set Trimming
1. When OS starts trimming the working set of SQL Server we would see drastic performance drop, increased I/O,non-yielding Resource Monitor / scheduler dumps etc..
2. IS-alive check failures resulting in SQL Server resource failure.
3. Resource monitor thread can start Garbage collector if SQLCLR is enabled on this instance of SQL. When Garbage collector is kicked off during memory pressure all other threads in the process are suspended. So if Garbage collector is taking a long time reosurce monitor thread appears stuck and hence the non-yielding errors and dumps are generated. (Refer http://support.microsoft.com/kb/2504603)
How to troubleshoot?
1. Capture perfmon counters (Process: Private bytes and Working set ) to determine which applications / windows component are requesting memory and causing OS to start trimming the working set of processes including SQL Server.
2. Use This exe which will print the memory information of all the processes and system wide memory information (Global memory status) when the operating system signals low memory notification.
3. Cap the SQL Server MAX Server Memory after considering the memory required by other applications, Operating system, Drivers , SQL Server Non- Bpool allocations etc. Make sure you have adequate available physical memory even when the system is under heavy load.
4. We can consider using the Lock pages in memory privilege. Remember it protects only the BPool from paging and Non-Bpool allocations can still be paged out.
If you liked this post, do like us on Facebook at https://www.facebook.com/mssqlwiki and join our Facebook group https://www.facebook.com/mssqlwiki#!/groups/454762937884205/
Windows 2008 and Windows 2008 R2 Known issues related to working set /Memory
SQL Server performance degraded in 32-Bit SQL Server after adding additional RAM.
Thank you,
Karthick P.K |My Facebook Page |My Site| Blog space| Twitter
I have 512 GB of memory on my physical box, out of which 85% is dedicated to SQL Server. I’m starting to get this message in error log. When this happens, SQL Server closes connection to other processes or users. Any guidance on what should I do here? Nothing runs on the server at this time when this happens. Any guidance would be much appreciated.
A significant part of SQL Server process memory has been paged out. This may result in a performance degradation.
Duration: 602 seconds. Working set (KB): 3860628, committed (KB): 342039316, memory utilization: 1%.
marc_s
729k175 gold badges1327 silver badges1455 bronze badges
asked Nov 7, 2017 at 14:59
5
You can prevent Windows from paging by granting the Lock Pages in Memory OS privilege to the SQL Server Service Account, or Per-Service SID.
See:
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/enable-the-lock-pages-in-memory-option-windows
This will cause SQL Server to bypass the Windows Virtual Memory manager, and directly allocate physical memory.
Beware that when you do this SQL Server will only respond to OS memory pressure slowly, and so other processes needing memory may not be able to run. SO it’s important to set Max Server Memory appropriately.
David
answered Nov 7, 2017 at 16:37
![]()
2
- Remove From My Forums
-
Question
-
Gurus,
I see a stack dump error too in addititon to error in the subject line. I have configured the setting for Max and Min memory and both have the same values. i.e 6400. My physical memory is 8 gb on the server.
Is this due to memory issue?
I am sql server 2008.
Please suggest.
Regards
Nitin
Best Regards Nitin
Answers
-
Nitin,
Read Karthik’s blog he wrote how to understand and analyze this problem. This might be helpful for you.
http://blogs.msdn.com/b/karthick_pk/archive/2012/06/22/a-significant-part-of-sql-server-process-memory-has-been-paged-out.aspx
Mark as ANSWER if I helped you today
www.sql-articles.com-
Proposed as answer by
Monday, June 24, 2013 8:31 PM
-
Marked as answer by
Fanny Liu
Friday, June 28, 2013 1:17 AM
-
Proposed as answer by
-
Please find below the copy olf the error log.
2013-06-18 10:19:34.420 Logon Error: 17806, Severity: 20, State: 14.
2013-06-18 10:19:34.420 Logon SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed.
The Windows error code indicates the cause of failure.
.2013-06-19 11:32:42.120 spid1s A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 335 seconds. Working set (KB): 2664328, committed (KB): 5264456,
memory utilization: 50%.2013-06-22 19:52:20.770 spid57 Error: 7393, Severity: 16, State: 1.
Hi ,
First SSPI handshake error..this means that communication between two domains is failing as there is not trust relationship between them which is required for comm. Contact ur AD team ask them to set trust relation ship between domains inolved
Working Set trimming: Windows is moving the allocated bytes of the process from physical RAM to page file because of memory pressure. Memory pressure is most commonly caused by applications or windows components that are requesting more memory causing
OS to start trimming working set of other processes to satisfy these new requests.Below link has solution to ur problem
http://blogs.msdn.com/b/karthick_pk/archive/2012/06/22/a-significant-part-of-sql-server-process-memory-has-been-paged-out.aspx
Also not noticed before You MAX SERVER MEMORY=MIN SERVER MEMORY this is seriously not advised make MIN SERVER MEMORY 0 MB AND LEAVE MAX SERVER MEMORY TO 6 GB.Please change it immediately
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
-
Edited by
Shanky_621MVP
Monday, June 24, 2013 5:51 AM
typo -
Proposed as answer by
Fanny Liu
Wednesday, June 26, 2013 2:04 AM -
Marked as answer by
Fanny Liu
Friday, June 28, 2013 1:17 AM
-
Edited by
-
-
Marked as answer by
Nitin1353
Monday, July 15, 2013 4:54 PM
-
Marked as answer by
