(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)
Description:
This wait type is when a thread is waiting while helping a background lazy writer thread and the system is under memory pressure with a heavy read and write workload. When a thread allocates memory, it comes from the buffer pool, and if the free list looks low, the thread will call a routine to help replenish the free list by writing dirty pages to disk or dropping clean pages from memory. If there are already a lot of outstanding writes, instead of issuing more writes, the thread instead waits and then loops.
(Books Online description: “Internal use only.”)
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:
2016
Removed in SQL Server version:
N/A
Extended Events wait_type value:
The map_key value in sys.dm_xe_map_values is 1099 in 2016 RTM. After 2016 RTM, you must check the DMV to get the latest value as some map_key values have changed in later builds.
Other information:
This is a normal wait type to see for threads in a system with memory pressure and heavy read and write workload. If this is a normal workload for your server, and it is already tuned for the best performance, I would filter this wait type out.
Known occurrences in SQL Server (list number matches call stack list):
- Helping the lazywriter, in this case while allocating memory for a new transaction object
- Helping the lazywriter, in this case while allocating memory for a new entry in the dirty page table after updating a record in a table
- Helping the lazywriter, in this case while allocating memory for space in the log pool while rolling back a transaction
And many other similar call stacks.
Abbreviated call stacks (list number matches known occurrences list):
- SOS_Task::PostWait+0x6f
SOS_Task::Sleep+0x140
BPool::HelpLazyWriter+0x192
SOS_MemoryWorkSpace::AllocatePage+0x659
MemoryNode::AllocatePagesInternal+0x311
MemoryClerkInternal::AllocatePagesWithFailureMode+0x176
MemoryClerkInternal::AllocatePages+0x3d
TVarPageMgr<0>::PbAllocate+0x1ee
CMemObj::Alloc+0x44
operator new+0x1f
CMsqlXactImpFactory::CreateMsqlXactManager+0xcc
AutoMsqlXactManager::FInitialize+0x115
SystemTaskEntryPoint+0x15a
OnDemandTaskContext::FuncEntryPoint+0x25
SOS_Task::Param::Execute+0x232
SOS_Scheduler::RunTask+0xb5 - SOS_Task::PostWait+0x6f
SOS_Task::Sleep+0x140
BPool::HelpLazyWriter+0x192
SOS_MemoryWorkSpace::AllocatePage+0x659
MemoryNode::AllocatePagesInternal+0x311
MemoryClerkInternal::AllocatePagesWithFailureMode+0x176
MemoryClerkInternal::AllocatePages+0x3d
CMemThread<CMemFixed>::PbGetNewPages+0x60
CMemFixed::Alloc+0x128
CMemThread<CMemFixed>::Alloc+0xd1
CMemPartitioned<CMemThread<CMemFixed>
CMemObj::Alloc+0x44
operator new+0x1f
RecoveryConfigMgr::GetFreeDPCBlock+0x13b
DirtyPageMgr2::GetFreeDPC+0x37
DirtyPageMgr::FirstPrepareToDirty+0xb8
RecoveryUnit::PrepareToDirty+0x1c2
BPool::PrepareToDirty+0x20f
PageRef::PrepareToDirty+0x1c
IndexPageRef::Modify+0x178
BTreeRow::UpdateRecord+0x27c0
IndexDataSetSession::SetDataInternal+0x72cf
DatasetSession::SetData+0x2b9 - SOS_Task::PostWait+0x6f
SOS_Task::Sleep+0x140
BPool::HelpLazyWriter+0x192
SOS_MemoryWorkSpace::AllocatePage+0x659
MemoryNode::AllocatePagesInternal+0x311
MemoryClerkInternal::AllocatePagesWithFailureMode+0x176
LogPool::AllocPages+0x53
LogPoolPrivateCacheBufferMgr::AllocCacheBuffer+0x53
LogConsumer::GetNextLogBlock+0x1572
SQLServerLogIterBackLink::GetNext+0x1fc
XdesRMReadWrite::RollbackToLsn+0x421
XdesRMFull::RollbackNested+0x56e
FullXactImpBase::RollbackNestedXact+0x13f
CMsqlXactInternalReadWrite::RollbackNestedXact+0x32
CMsqlXactImp::RollbackNestedXact+0x19
CAutoMsqlXact::RollbackNestedXact+0x5f
CXStmtDML::RollbackNestedXact+0x1b
CXStmtDML::FinishOnExceptionImp+0x13d