Friday, October 1, 2010

Lazy Writer Process

There are two built in automatic mechanisms SQL Server uses to scan the buffer cache periodically and writes any dirty pages to disk.
The Lazy Writer and Checkpoint process
Lazy Writer Process :
It scans the buffer cache periodically and writes dirty pages to disk.It sleeps for specific interval of time when it wakes up, it examines the size of free buffer list.If the free buffer list is below a certain point, the lazy writer thread scans the buffer pool to repopulate the free buffer list.As buffers are added to free list, they are also written to disk if they are dirty.
The lazywriter expands or shrinks the data cache to keep the operating system’s free physical memory at 5 MB (plus or minus 200 KB) to prevent paging. If the operating system has less than 5 MB free, the lazywriter releases memory to the operating system instead of adding it to the free list. If more than 5 MB of physical memory is free, the lazywriter recommits memory to the buffer pool by adding it to the free list.

No comments:

Post a Comment