memusage and memory_usage on sys.sysprocesses and sys.dm_exec_sessions

sakuraime 2,351 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 | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Cris Zhan-MSFT 6,671 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


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.