Is plan cache included in Buffer Pool?

Hello community, I’m facing with a question that drives me crazy: I try to figure out if plan cache (like other memory areas) are included in buffer pool. I consider the output of sys.dm_os_memory_clerks, where MEMORYCLERK_SQLBUFFERPOOL, MEMORYCLERK_SQLCONNECTIONPOOL, CACHESTORE_SQLCP seem to be distinct memory areas. From that I understand that plan cache (CACHESTORE_SQLCP + CACHESTORE_OBJCP + CACHESTORE_PHDR + CACHESTORE_XPROC) is not included in MEMORYCLERK_SQLBUFFERPOOL because they are different clerk types. Moreover, I run DBCC FREEPROCCACHE, and I noticed that MEMORYCLERK_SQLBUFFERPOOL clerk memory is not changed at all, while the above mentioned CACHESTORE_SQLCP,CACHESTORE_OBJCP,CACHESTORE_PHDR, CACHESTORE_XPROC become ZERO. So, I suppose that plan cache is not include, but I read that some authors say the opposite. Which is the correct answer? Thanks a lot Alessandro

avatar image By Alessandro 16 asked Dec 15, 2016 at 12:43 PM
more ▼
(comments are locked)
10|10000 characters needed characters left

1 answer: sort voted first

I think the main problem is that some people call all of SQL Server's usable memory the "buffer pool" - usually what they really mean by this is the memory that contains the buffer pool, the plan cache, and other memory allocations. They are indeed separate, but they do affect each other (see this article).

avatar image By Aaron Bertrand ♦ 1.7k answered Jan 08 at 04:51 PM
more ▼
(comments are locked)
10|10000 characters needed characters left
Your answer
toggle preview:

Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.

Follow this question

Topics:

x6
x1

asked: Dec 15, 2016 at 12:43 PM

Seen: 43 times

Last Updated: Jan 08 at 04:51 PM