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

How to know SQL Server Memory Utilization Expand / Collapse
Author
Message
Posted Monday, September 24, 2012 5:22 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:51 PM
Points: 99, Visits: 617
Hi All,

We have SQL 2008R2 Standard Ed.(64 bit) installed on Windows 2008 R2. Physical RAM on Server is 48GB.

We have set SQL maximum memory to 35GB.

Is there any way to know about how much memory is getting utilized by the SQL server out of 35GB.
Below are some details

Target Server Memory (KB) = 36700160
Total Server Memory (KB) = 36700160

Memory from task manager in MB

Total 49142
Cached 2648
Available 8222
Free 5624

sqlsvr.exe 38456316 (in KB)

Which information is correct how do I calculate memory usage for SQL out of 35GB (35840MB)
Post #1363422
Posted Monday, September 24, 2012 11:59 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:19 PM
Points: 7,127, Visits: 12,655
Amount of memory being used for the buffer pool:

SELECT  CAST((bpool_committed * 8) / (1024.0 * 1024.0) AS DECIMAL(20, 2)) AS BufferPoolCommittedMemoryGB
FROM sys.dm_os_sys_info;



__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1363663
Posted Monday, September 24, 2012 11:03 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:51 PM
Points: 99, Visits: 617
Hi,

Thanks for your reply.

Out put of your query is 35GB which I have set for max server memory.

I got some query from blog of SSC only which give the utilization of buffer.


With CTE_BP(DatabaseName, BufferSizeInMB )
as
(
SELECT
case when DB_NAME(b.database_id) is null then 'Resource DB' else DB_NAME(b.database_id) end AS database_name
,(cast(COUNT(*) as decimal(20,2)) * 8192.00) / (1024.00 * 1024) AS buffer_count_MB
FROM sys.dm_os_buffer_descriptors AS b
GROUP BY b.database_id
)
select * from CTE_BP order by BufferSizeInMB desc

Here is the out put memory in MB

db1 18035.23438
db2 5483.632813
tempdb 2719.28125
db3 1926.796875
db4 718.359375
msdb 98.3828125
Resource DB 18.625
master 0.9609375
model 0.359375


If I some up this 29001.63281 MB. So now what is the difference between bpool_commited memory & buffer descriptor memory. Can I some how know the details of 35GB utilization same like buffer descriptor memory so that I can properly justify the 35GB as the max server memory setting.
Post #1363778
Posted Tuesday, September 25, 2012 12:40 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 @ 5:52 AM
Points: 43,042, Visits: 36,200
Your query returns the size of the data cache, which is one component of the buffer pool. There are a lot of other caches including the plan cache also within the buffer pool.


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 #1363812
Posted Tuesday, September 25, 2012 1:38 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:51 PM
Points: 99, Visits: 617
Thanks for the reply Gail.

so bpool_commited is the only consolidated way to describe the memory usage out of max server memory setting.

Any reference to calculate memory of all component will be helpful..


Post #1363831
Posted Tuesday, September 25, 2012 2:45 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, March 21, 2014 9:46 AM
Points: 387, Visits: 1,078
select Type, SUM(single_pages_kb)/(1024.00) SingleP_MB
, SUM(Multi_pages_kb)/(1024.00) MultiP_MB
, SUM(virtual_memory_committed_kb)/(1024.00) VirtualP_MB
, SUM(shared_memory_committed_kb)/(1024.00) SharedP_MB
, SUM(awe_allocated_Kb)/(1024.00) AWEp_MB From sys.dm_os_memory_clerks
Group by type

try this..
Post #1363858
Posted Tuesday, September 25, 2012 5:23 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:51 PM
Points: 99, Visits: 617
Thanks for the reply.

I have attached out put of this query in excel format.

So then SQL max server memory = Sum(SingleP_MB)+Sum(MultiP_MB)+data cache memory.

Please correct if I am wrong.

Thanks again to all for all great efforts.


  Post Attachments 
memory utilization.xlsx (15 views, 13.21 KB)
Post #1363953
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse