Extracting instance memory usage

  • Hi there,

    I would like to figure out how much memory (in total) a 64 bit instance is using through T-SQL. NOT what the OS/Task Manager states, but what SQL is actually using - There is a difference.

    This, together with other relevant stats, will be periodically captured & used to motivate if/why hardware upgrades are needed.

    Microsoft's documentation on using DBCC memorystatus (http://support.microsoft.com/kb/907877 ) doesn't help me too much 🙁

    I've scoured the net without much luck - Any help would be greatly appreciated.

    Thanks,

    Lian

  • You can use the DMV sys.dm_os_performance_counters. This DMV gives you the performance monitor’s counters in a table format. The query bellow shows how to get the memory that is used by the server:

    select * from sys.dm_os_performance_counters

    where counter_name = 'Total Server Memory (KB)'

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Thanks a mil Adi,

    This isn't 100% what I was looking for, but is definately a step in the right direction, I'll play around with the counters & see if there's anything that might help

  • Lian Pretorius (10/28/2009)


    Thanks a mil Adi,

    This isn't 100% what I was looking for, but is definately a step in the right direction, I'll play around with the counters & see if there's anything that might help

    What exactly are you after?

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • On second thoughts, it looks like it might do the job - Thanks again!

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

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