SOS_MEMORY_TOPLEVELBLOCKALLOCATOR

(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)

(Back to main page…)

Description:

This wait type is when a thread is waiting for access to a critical section of code inside the memory allocator that steals memory from the buffer pool.

(Books Online description: N/A)

Questions/comments on this wait type? Click here to send Paul an email, especially if you have any information to add to this topic.

Added in SQL Server version:

2012

Removed in SQL Server version:

N/A

Extended Events wait_type value:

The map_key value in sys.dm_xe_map_values is 128 in 2012 and 2014 RTM. After 2014 RTM, you must check the DMV to get the latest value as some map_key values have changed in later builds.

Other information:

There have been cases where this wait type becomes prevalent if the server runs out of Virtual Address Space and the memory allocator takes a long time to allocate large chunks of memory. There was a bug in 2012 and 2014 that would cause this wait type – see KB article 3074434.

Known occurrences in SQL Server (list number matches call stack list):

  1. Waiting for the memory allocator mutex (in this case, while stealing memory from the buffer pool to give to a sort operation)

And other similar call stacks.

Abbreviated call stacks (list number matches known occurrences list):

  1. SOS_Task::PostWait+90
    EventInternal<SuspendQueueSLock>::Wait+2c6
    SOS_RecursiveMutex::Wait+a9
    TAutoMutex<SOS_RecursiveMutex,4294967295>::GetAccess+d9
    SOS_MemoryTopLevelBlockAllocator::AllocateBlock+ad
    SOS_MemoryBlockAllocator::GetNewActiveBlockFromParent+271
    SOS_MemoryBlockAllocator::AllocateBlockInt+17f
    SOS_MemoryBlockAllocator::GetNewActiveBlockFromParent+99
    SOS_MemoryBlockAllocator::AllocateBlockInt+17f
    SOS_MemoryBlockAllocator::GetNewActiveBlockFromParent+99
    SOS_MemoryBlockAllocator::AllocateBlockInt+17f
    SOS_MemoryBlockAllocator::GetNewActiveBlockFromParent+99
    SOS_MemoryBlockAllocator::AllocateBlockInt+17f
    SOS_MemoryBlockAllocator::AllocateBlock+31e
    SOS_MemoryWorkSpace::AllocatePage+270
    MemoryClerkInternal::AllocateReservedPages+83
    BPool::Steal+334
    PbufGetGrantedBufs+7e
    soGetBuf+ac
    soAllocRecBuf+3e8
    RowsetSorted::InsertRow+2b97
    RowsetChangeSort::InsertRow+19