HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

SQL Server's Buffer Cache Size steadily decreasing

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
steadilydecreasingsqlsizecacheserverbuffer

Problem

We have been having an issue with SQL Server where the buffer cache size decreases over time to the point that we have to restart the service to free up the memory. It gets low enough that is affecting performance.

The server itself has 32GB of RAM. We set the max memory on the SQL Server to 28GB. At the time of writing this the buffer cache is 5.5GB.

The version of the SQL Server is


Microsoft SQL Server 2014 - 12.0.2269.0 (X64)
Jun 10 2015 03:35:45
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: )

The output of sys.dm_os_process_memory is:

  • total_physical_memory_kb 33539548



  • available_physical_memory_kb 926132



  • total_page_file_kb 41427432



  • available_page_file_kb 5588408



  • system_cache_kb 977004



  • kernel_paged_pool_kb 171908



  • kernel_nonpaged_pool_kb 166596



  • system_high_memory_signal_state 1



  • system_low_memory_signal_state 0



  • system_memory_state_desc Available physical memory is high



We have a tool called Idera and it is able to provide a visual representation of the memory over time. Below is the buffer cache size over 3 weeks.

I don't know how useful this next picture is but it is the reason I am so confused over the memory use.

After a restart, the yellow area is completely gone and its just SQL allocated and SQL used. I have looked through numerous views but I have not been able to determine what is using this extra memory. If you have any suggestions or require more information please let me know.

Thanks in advance!

The services running on the server are below.

This server is used only for SQL Server. Looking at the task manager right now sqlservr.exe is using 30,264,240 K and the next highest is explorer.exe using 64,704 K

dbcc memorystatus:

```
Process/System Counts Value
---------------------------------------- --------------------
Available Physical Memory 959946752
Available Virtual Memory 14061002

Solution

Process Working Set 31GB, which is the portion of the process committed virtual memory currently in RAM. So the SQL Process is using 31GB of RAM.

SQLOS VM Committed is only 5,687MB, and Locked Pages Allocated is 0. SO SQLOS can only account for 6GB of the memory usage.

So something in the process is using 25GB of memory, and it's not SQL Server. The typical culprit here a linked server driver, which allocates memory in the process which is not tracked by SQL Servers memory clerks and pools.

You mentioned linked server to Oracle. What OleDB driver and version are you using? Any other linked server drivers used?

Eventually you need to figure out what's leaking memory in the SQL Server process and fix or eliminate it. In the short term you can bounce the SQL Server process periodically.

A good way to eliminate loading linked server drivers in SQL Server is to use SSIS. For reading data from remote sources the SSIS Data Streaming Destination enables you to isolate the 3rd party data access components in a short-lived process and still query from them like a linked server.

Context

StackExchange Database Administrators Q#205712, answer score: 4

Revisions (0)

No revisions yet.