Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I run DBCC FREEPROCCACHE when I want to wipe information out of the buffer pool between running SQL queries. However, I was reviewing this Technet article referencing DBCC FREESYSTEMCACHE. What caches does FREESYSTEMCACHE wipe that FREEPROCCACHE doesn't?

share|improve this question
up vote 17 down vote accepted

What caches does FREESYSTEMCACHE wipe that FREEPROCCACHE doesn't?

There are many system caches available in SQL Server. I am referring to SQL 2008R2 (as I tested on it).

Below query will return all the caches available :

--- ONLY for Educational purpose. Don't attempt to run on PROD !!

select 'DBCC freesystemcache ('+''''+name+''''+')'  from   sys.dm_os_memory_clerks group by name
-- 155 rows

so for e.g. you want to clear all caches you will run


for specific caches to be cleared you can run

DBCC FREESYSTEMCACHE ('userdatabase') -- cleans cache for specific user database
DBCC FREESYSTEMCACHE ('tempdb')  -- clears cache for tempdb
DBCC FREESYSTEMCACHE ('Temporary Tables & Table Variables') -- clears all the temp table and variables
.. and many more (see above 155 rows returned from sql server 2008R2)

Using FREEPROCCACHE, you wont be able to clear all above mentioned at that detailed level.


Removes all elements from the plan cache, removes a specific plan from the plan cache by specifying a plan handle or SQL handle, or removes all cache entries associated with a specified resource pool.

So essentially, you might think of it as only related to Plan cache with the ability to remove specific plans from the cache with the plan handle and or pool name.

Fun With DBCC FREEPROCCACHE is a blog from Glenn Berry

share|improve this answer
+1 very nice details – Aaron Bertrand Jan 15 '14 at 22:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.