SQL Server:sys.dm_os_memory_clerks shows duplicate entries for memory clerks

Hi Friends,

In last week of August, I observed that sys.dm_os_memory_clerks was showing duplicate entries for all the memory clerks. For example, if I run the following code in SQL Server 2008 RTM:

select * from sys.dm_os_memory_clerks
where type = 'MEMORYCLERK_SQLBUFFERPOOL'

I get the following output:

1_SQL_Serversys.dm_os_memory_clerks_shows_duplicate_entries_for_memory_clerks

You can observe that there are 2 entries for the BUFFER POOL memory clerk. Initially, I thought that it is for different memory nodes and I was wondering that it could have something to do with NUMA. But if you observer that memory_node_id columns shows 0 for both the entries, leaving me completely baffled, more so when the memory_clerk_address for both the records are different.

I interacted with my MVP colleagues Maciej Pilecki & Adam Mechanic (SQL MVPs) tried to figure out the issue. Adam pointed out that this could be for DAC (Dedicated Administrator Connection) – but then the memory node id should be different. Finally Umachandar Jayachandran, Robert Dorr & Bob Ward from Microsoft intervened and we figured out that this is an issue and not well known by many. So here is the story:

The other entry (what we see as duplicate) is actually for DAC and Adam was right. SQL Server 2008 RTM shows the physical memory node (0) for DAC entry which is incorrect. This issue was fixed in R2. If you run the same DMV in SQL Server 2008 R2, you will get the correct output as follows:

2_SQL_Serversys.dm_os_memory_clerks_shows_duplicate_entries_for_memory_clerks

Memory Node ID 64 is logical and belongs to DAC.

Thanks to all the MVPs and folks from Microsoft helping me resolve this.

 

 

Amit Bansal

About Amit Bansal

Amit Bansal is always brainstorming around SQL Server. Despite working with SQL since 1997, he is amazed that he keeps learning new things every single day. SQL Server is AB's first love, and his wife does not mind that. He tries to share as much and spreads the SQL goodness. Internals and Performance Tuning excites him, and also gives him sleepless nights at times, simply because he is not a genius, but quite a hard worker and does not give up. It has been a long and exciting journey since 1997, you can read here: http://sqlmaestros.com/amit-bansal/ He is on Twitter: https://www.twitter.com/A_Bansal

View all posts by Amit Bansal →

3 Comments on “SQL Server:sys.dm_os_memory_clerks shows duplicate entries for memory clerks”

  1. Indeed; I mentioned this in my blog that Microsoft engineers intervened to resolve this. This could have been written by Robert, Bob or their team after it was notified by me.

Leave a Reply

Your email address will not be published. Required fields are marked *