How to find the amount of memeory SQL Server is consuming

  • Hello

    I need to build a report on capacity and am trying to find a counter that I can use to measure the % of memory SQL server is using. I've researched total server memory vs target server memory but have found that these are not very useful for what I am trying to do. I want to take a snapshot of the amount of memory it is using on a daily basis and compare this to the toal amount of memory available so as I can build somehow graph the results so as I can predict any future memory issues

  • Try DBCC MEMORYSTATUS

  • SELECT cntr_value AS [amount of memory SQL is using in KB]

    FROM sys.dm_os_performance_counters

    WHERE counter_name = 'Total Server Memory (KB)';

    SELECT physical_memory_in_bytes / 1024.0 AS [amount of usable physical memory in the server in KB]

    FROM sys.dm_os_sys_info;

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • If you mean how much it's using at the OS level, fair warning, that graph is likely to be very flat. SQL Server grabs as much memory as it can and holds on to it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply