memusage and memory_usage on sys.sysprocesses and sys.dm_exec_sessions

sakuraime 2,321 Reputation points
2021-01-29T05:11:01.333+00:00

https://learn.microsoft.com/en-us/sql/relational-databases/system-compatibility-views/sys-sysprocesses-transact-sql?view=sql-server-ver15
there are columns

memusage on sys.sysprocesses sys.dm_exec_sessions

memory_usage on sys.dm_exec_sessions

are they referring the same things ?
61694-image.png

is this the actually the size of the execution plan in the cache?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,895 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Cris Zhan-MSFT 6,611 Reputation points
    2021-02-04T09:13:58.29+00:00

    Hi,

    >is this the actually the size of the execution plan in the cache?

    No, there is no correlation between buffer pool (cached data), procedure cache (execution plans), memory allocation and users (sessions).
    https://stackoverflow.com/questions/33669296/determine-amount-of-memory-cached-by-user-in-sql-server

    >what's memory_usage on sys.dm_exec_sessions?

    Just a guess, but I would assume that this is the number of 8KB pages being used to manage the session.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a61b5a15-9530-451f-bc6d-d52b0b0a8b16/sysdmexecsessions-memoryusage-values-only-0-2-or-3?forum=sqldatabaseengine

    0 comments No comments