{"id":2101,"date":"2023-03-09T11:51:11","date_gmt":"2023-03-09T11:51:11","guid":{"rendered":"https:\/\/www.theSQLReport.com\/?p=2101"},"modified":"2023-03-09T11:51:11","modified_gmt":"2023-03-09T11:51:11","slug":"query-percentage-of-physical-memory-sql-server-is-currently-using","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=2101","title":{"rendered":"Query &#8211; Percentage of Physical Memory SQL Server is Currently Using"},"content":{"rendered":"<p>Note: Unlike other queries I have share here at TheSQLReport, I am the author of this one. \u00a0 Sharing because I could not find it in my Google Searches.\u00a0 Tested this back to version SQL Server 2012. \u00a0 Also please remember that physical_memory_in_use_kb may be a constantly changing number depending on how SQL Server\u00a0 is configured &amp; the activity of the operating system.<\/p>\n<pre>--\r\n-- Percentage of Physical Memory SQL Server is Currently Using\r\n-- \r\nselect\r\nsys.dm_os_sys_info.physical_memory_kb\/1024 AS [OS RAM \/ Physical Memory (MB)],\r\nsys.dm_os_process_memory.physical_memory_in_use_kb\/1024 as [Physical Memory SQL Using (MB)],\r\nFORMAT((\r\nCONVERT( numeric,sys.dm_os_process_memory.physical_memory_in_use_kb) \/\r\nCONVERT( numeric,sys.dm_os_sys_info.physical_memory_kb)\r\n),'P', 'en-us') as [Percentage of Physical Memory SQL Using]\r\nFROM\r\nsys.dm_os_sys_info,\r\nsys.dm_os_process_memory;<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2023\/01\/PercentageOfPhysicalMemorySQLServerIsCurrentlyUsing.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2102 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2023\/01\/PercentageOfPhysicalMemorySQLServerIsCurrentlyUsing.jpg\" alt=\"\" width=\"732\" height=\"310\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: Unlike other queries I have share here at TheSQLReport, I am the author of this one. \u00a0 Sharing because I could not find it in my Google Searches.\u00a0 Tested &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=2101\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2102,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[210,209,207,208],"class_list":["post-2101","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-server","tag-physical_memory_in_use_kb","tag-physical_memory_kb","tag-sys-dm_os_process_memory","tag-sys-dm_os_sys_info"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/2101"}],"collection":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2101"}],"version-history":[{"count":3,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/2101\/revisions"}],"predecessor-version":[{"id":2105,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/2101\/revisions\/2105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/2102"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}