{"id":654,"date":"2010-04-26T05:44:45","date_gmt":"2010-04-26T09:44:45","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=654"},"modified":"2013-03-20T08:42:48","modified_gmt":"2013-03-20T12:42:48","slug":"howto-check-memoryram-usage-in-linux","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/howto-check-memoryram-usage-in-linux","title":{"rendered":"Howto: Check Memory\/RAM usage in Linux"},"content":{"rendered":"<p><strong>How to check Memory (RAM) usage in Linux OR different ways to check RAM usage in Linux? <\/strong><\/p>\n<p>Memory OR widely known as RAM is known to be one of the important component on the server which make sure the tasks performed on your server are processed fast enough. Higher the availibility of physical memory, more stable is your server during high resource usage processes.<\/p>\n<p>Linux offer various tools to check Memory\/RAM usage of your server such as free, top, sar, vmstat etc using which you can deside whether to optimize softwares to use less memory OR whether it&#8217;s time to upgrade memory on the server.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>1) &#8216;free&#8217; command<\/strong><\/span>: one of the easiest way to check the RAM usage:<\/p>\n<p><strong>free -m<\/strong><br \/>\nwill display physical memory as well as Swap<\/p>\n<p><a href=\"https:\/\/linuxhostingsupport.net\/blog\/howto-check-memoryram-usage-in-linux\/free1-3\" rel=\"attachment wp-att-686\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-686\" title=\"free1\" src=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/free12.jpg\" alt=\"\" width=\"589\" height=\"111\" srcset=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/free12.jpg 589w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/free12-300x56.jpg 300w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/free12-570x107.jpg 570w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><\/a><\/p>\n<p><strong>free -m -t<\/strong><br \/>\nsame as above but it will display the total of physical and swap memory at the bottom.<\/p>\n<p><a href=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/free2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-666\" title=\"free2\" src=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/free2.jpg\" alt=\"\" width=\"589\" height=\"127\" \/><\/a><\/p>\n<p><span style=\"color: #0000ff;\"><strong>2) &#8216;top&#8217; command<\/strong><\/span>: The top command displays the real time values of the running system and are continously updated (by default 3 seconds). The two rows &#8220;Mem and Swap&#8221; displays the total, used and free amount of RAM\/Swap. Though the values displayed are in kbs and not human readable, it is just one another way to check the usage.<\/p>\n<p><a href=\"https:\/\/linuxhostingsupport.net\/blog\/howto-check-memoryram-usage-in-linux\/top\" rel=\"attachment wp-att-695\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-large wp-image-695\" title=\"top\" src=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/top-585x118.jpg\" alt=\"\" width=\"585\" height=\"118\" srcset=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/top-585x118.jpg 585w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/top-300x60.jpg 300w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/top.jpeg 622w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/a><\/p>\n<p><span style=\"color: #0000ff;\"><strong>3) &#8216;sar&#8217; command<\/strong><\/span>: is included in the &#8216;sysstat&#8217; package and is not installed by default. To install &#8216;sysstat&#8217; package, execute:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>yum install sysstat<\/strong><\/span><\/p><\/blockquote>\n<p>Once &#8216;sysstat&#8217; package is installed, start the service<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>service sysstat start<\/strong><\/span><\/p><\/blockquote>\n<p>sysstat package when installed, provider &#8216;sar&#8217; command which collects system activity information and saves it in a file before displaying it on a standard output.<\/p>\n<p><strong>sar -r<\/strong><br \/>\ndisplays Memory\/Buffer\/Swap information horizontally.<\/p>\n<p><a href=\"https:\/\/linuxhostingsupport.net\/blog\/howto-check-memoryram-usage-in-linux\/sar\" rel=\"attachment wp-att-702\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-large wp-image-702\" title=\"sar\" src=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/sar-585x114.jpg\" alt=\"\" width=\"585\" height=\"114\" srcset=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/sar-585x114.jpg 585w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/sar-300x58.jpg 300w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/sar.jpg 817w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/a><\/p>\n<p><span style=\"color: #0000ff;\"><strong>4) \/proc\/meminfo file<\/strong><\/span>: which displays everything about the RAM on your server.<\/p>\n<p><strong>cat \/proc\/meminfo<\/strong><br \/>\n<a href=\"https:\/\/linuxhostingsupport.net\/blog\/howto-check-memoryram-usage-in-linux\/meminfo\" rel=\"attachment wp-att-707\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-707\" title=\"meminfo\" src=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/meminfo.jpg\" alt=\"\" width=\"279\" height=\"527\" srcset=\"https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/meminfo.jpg 279w, https:\/\/linuxhostingsupport.net\/blog\/wp-content\/uploads\/2010\/04\/meminfo-79x150.jpg 79w\" sizes=\"(max-width: 279px) 100vw, 279px\" \/><\/a><\/p>\n<h3><\/h3>\n<h3><span style=\"text-decoration: underline;\"><span style=\"color: #0000ff;\"><strong>Related Links<\/strong><\/span>:<\/span><\/h3>\n<h3><span style=\"color: #0000ff;\"><strong><a title=\"How to find out CPU utilization in Linux?\" href=\"https:\/\/linuxhostingsupport.net\/blog\/how-to-find-out-cpu-utilization-in-linux-2\" target=\"_blank\">How to find out CPU utilization in Linux?<\/a><\/strong><\/span><\/h3>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 798px; width: 1px; height: 1px; overflow: hidden;\">\n<p>Once &#8216;sysstat&#8217; package is installed, start the service<\/p>\n<p><span style=\"color: #0000ff;\"><strong>service sysstat start<\/strong><\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to check Memory (RAM) usage in Linux OR different ways to check RAM usage in Linux?<br \/>\nMemory OR widely known as RAM is known to be one of the important component on the server which make sure the tasks performed on your server are processed fast enough. Higher the availibility of physical memory, more stable is your server during high resource usage processes.<br \/>\nLinux offer various tools to check Memory\/RAM usage of your server such as free, top, sar, vmstat etc using which you can deside whether to [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[815,816,817,818,820,819],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/654"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=654"}],"version-history":[{"count":68,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/654\/revisions"}],"predecessor-version":[{"id":2211,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/654\/revisions\/2211"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}