Saturday, December 2, 2017

Things to know about DBCC DROPCLEANBUFFERS


You may have observed that sometimes DROPCLEANBUFFERS is not working as you expected. And there are still some pages in buffer area.

This is because "DBCC DROPCLEANBUFFERS" drops only CLEAN pages from the buffer pool.

A clean page is one that has not been changed since it was read into memory or last written to disk. A dirty page is one that has not been written to disk since it was last changed. Dirty pages are not dropped by DBCC DROPCLEANBUFFERS, they are only made clean by writing them to disk (either through one of the various kinds of checkpoints or by the lazy writer – or one of the per-NUMA node lazy writers if you have NUMA configured).

If you want that all pages from a database are flushed from memory, you need to first perform a manual CHECKPOINT of that database and then run DBCC DROPCLEANBUFFERS.

Thank You!


No comments:

Post a Comment