Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Sql Server memory consumption reaching to high.. Expand / Collapse
Author
Message
Posted Wednesday, March 19, 2014 6:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:41 AM
Points: 4, Visits: 5
Hi Friends,

I am facing a issue, since couple of days.
Sql server memory is slowly consuming all memory of server. And when it reaches to max limit, my applications hosted on server gets slow and stops working.

SQL Server is having 65 GB RAM

Min Limit set to 0, and Max limit set to 40GM, in sql server configuration.

I also scheduled to execute following scripts , in sql server agent.

CHECKPOINT
DBCC DROPCLEANBUFFERS

DBCC FREESESSIONCACHE

DBCC FREEPROCCACHE

DBCC FREESYSTEMCACHE('All')

I also tried -

EXEC sp_configure 'show advanced option', '1';

I tried to analyze memory consumption, using following scripts -

SELECT COUNT(*) AS CACHED_PAGES_COUNT,
NAME AS BASETABLENAME, INDEXNAME,
INDEXTYPEDESC
FROM SYS.DM_OS_BUFFER_DESCRIPTORS AS BD
INNER JOIN
(
SELECT S_OBJ.NAME, S_OBJ.INDEX_ID,
S_OBJ.ALLOCATION_UNIT_ID, S_OBJ.OBJECT_ID,
I.NAME INDEXNAME, I.TYPE_DESC INDEXTYPEDESC
FROM
(
SELECT OBJECT_NAME(OBJECT_ID) AS NAME,
INDEX_ID ,ALLOCATION_UNIT_ID, OBJECT_ID
FROM SYS.ALLOCATION_UNITS AS AU
INNER JOIN SYS.PARTITIONS AS P
ON AU.CONTAINER_ID = P.HOBT_ID
AND (AU.TYPE = 1 OR AU.TYPE = 3)
UNION ALL
SELECT OBJECT_NAME(OBJECT_ID) AS NAME,
INDEX_ID, ALLOCATION_UNIT_ID, OBJECT_ID
FROM SYS.ALLOCATION_UNITS AS AU
INNER JOIN SYS.PARTITIONS AS P
ON AU.CONTAINER_ID = P.PARTITION_ID
AND AU.TYPE = 2
) AS S_OBJ
LEFT JOIN SYS.INDEXES I ON I.INDEX_ID = S_OBJ.INDEX_ID
AND I.OBJECT_ID = S_OBJ.OBJECT_ID ) AS OBJ
ON BD.ALLOCATION_UNIT_ID = OBJ.ALLOCATION_UNIT_ID
WHERE DATABASE_ID = DB_ID()
GROUP BY NAME, INDEX_ID, INDEXNAME, INDEXTYPEDESC
ORDER BY CACHED_PAGES_COUNT DESC;
GO

--To see the number of pages cached in memory and the amount of RAM used in MB:

select count(*) AS Page_Count
,count(*) * 8 / 1024 as Cached_Size_MB
from sys.dm_os_buffer_descriptors


--To see the number of pages cached in memory and the amount of RAM used in MB for each database:

SELECT count(*)AS Page_Count
,count(*) * 8 / 1024 as Cached_Size_MB
,CASE database_id
WHEN 32767 THEN 'ResourceDb'
ELSE db_name(database_id)
END AS Database_name
FROM sys.dm_os_buffer_descriptors
GROUP BY db_name(database_id) ,database_id
ORDER BY Page_Count DESC;

--To see the count of pages cached in memory for each object in the current database:
USE TMS
GO

SELECT count(*)AS Page_Count
,object_name ,index_id
FROM sys.dm_os_buffer_descriptors AS bd
INNER JOIN
(
SELECT object_name(object_id) AS object_name
,index_id ,allocation_unit_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.hobt_id
AND (au.type = 1 OR au.type = 3)
UNION ALL
SELECT object_name(object_id) AS name
,index_id, allocation_unit_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.partition_id
AND au.type = 2
) AS obj
ON bd.allocation_unit_id = obj.allocation_unit_id
WHERE database_id = db_id()
GROUP BY object_name, index_id
ORDER BY Page_Count DESC;

But its not helping me out..

Can anyone pls suggest on the same?
Post #1552591
Posted Wednesday, March 19, 2014 7:45 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:05 AM
Points: 42,829, Visits: 35,959
First things first, take that agent job out. Scheduling some major performance degradation is usually not something you do to a production system.

Is it SQL which is consuming the memory? How did you check?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1552613
Posted Thursday, March 20, 2014 12:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:41 AM
Points: 4, Visits: 5
Thnx Gail

Yes, I had disabled the job. Although I scheduled it temporarily.

Yes, SQLServer.exe is consuming all the available memory with the server.

Post #1552871
Posted Thursday, March 20, 2014 2:35 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:05 AM
Points: 42,829, Visits: 35,959
GilaMonster (3/19/2014)
Is it SQL which is consuming the memory? How did you check?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1552897
Posted Monday, March 24, 2014 12:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:41 AM
Points: 4, Visits: 5
1. In task manager SQLServer.exe memory consumption is shown as 65GB
2. After restarting it, everything starts working normally for 17 to 18 Hours
3. Again memory consumption goes to 10%.

Post #1553871
Posted Monday, March 24, 2014 12:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:41 AM
Points: 4, Visits: 5
I mean again memory consumption goes to 100%, pls ignore 10%
Post #1553872
Posted Monday, March 24, 2014 3:01 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, April 28, 2014 5:50 PM
Points: 37, Visits: 303
Hello,

By default SQL Server is designed to use memory in large quantities, in order to cache data pages, plans and other DB objects in the Memory (Buffer pool).Under noramal conditions SQL Serevr will consume as much memory as it needs from the available RAM. When OS sets the memory low resource notification flag it is under these circumstances SQL Server will trim its working set (memory usage).

In order to avoid such a behaviour set the MAX_SERVER_MEMORY sp_configure option.

Refrence: http://www.red-gate.com/community/books/accidental-dba (Chap 4)
Post #1554221
Posted Tuesday, March 25, 2014 12:27 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:14 PM
Points: 1,194, Visits: 2,217
Are you experiencing any memory pressures on the server or memory related errors ?

--
SQLBuddy
Post #1554638
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse