{"id":1924,"date":"2020-11-18T21:09:24","date_gmt":"2020-11-18T21:09:24","guid":{"rendered":"https:\/\/linuxways.net\/?p=1924"},"modified":"2020-11-20T15:20:52","modified_gmt":"2020-11-20T15:20:52","slug":"4-ways-to-check-memory-usage-in-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/4-ways-to-check-memory-usage-in-centos-8\/","title":{"rendered":"4 ways to check memory usage in CentOS 8"},"content":{"rendered":"<p>Sometimes, when you are working on a Linux environment, you may need to install some new packages on a daily basis. For this purpose, you need to check memory usage to install a new program. So, you should know how to check available and installed RAM or memory on your system.<\/p>\n<p>In this article, we will explore some major commands that are useful to check the memory usage in CentOS 8.<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<p>You should have root account or sudo privileges to run the administrative commands.&nbsp;<\/p>\n<p>You can check the memory usage on your CentOS 8 Linux system by using the following five different commands which we will explain one by one in detail:<\/p>\n<ol>\n<li>Cat command<\/li>\n<li>Free command<\/li>\n<li>Vmstat command<\/li>\n<li>Top command<\/li>\n<li>Htop command<\/li>\n<\/ol>\n<h2><strong>Use of cat command<\/strong><\/h2>\n<p>Open the terminal and type cat \/proc\/meminfo on the terminal window. It will open the \/proc\/meminfo virtual file that displays the information about used and available memory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1101\" height=\"753\" class=\"wp-image-1925\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-545.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-545.png 1101w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-545-300x205.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-545-1024x700.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-545-768x525.png 768w\" sizes=\"auto, (max-width: 1101px) 100vw, 1101px\" \/><\/p>\n<p>It displays the real-time information about the memory usage as well as the shared memory which is used by the kernel, buffers details.&nbsp;&nbsp;<\/p>\n<h2><strong>Use of free command<\/strong><\/h2>\n<p>When you will execute the free command on the terminal, it will display the following information:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1106\" height=\"136\" class=\"wp-image-1926\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-546.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-546.png 1106w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-546-300x37.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-546-1024x126.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-546-768x94.png 768w\" sizes=\"auto, (max-width: 1106px) 100vw, 1106px\" \/><\/p>\n<p>The above-displayed image contains different terms that we will explain one by one as follows:<\/p>\n<p>Data represented in the above image, such as under the used, available, and swap memory terms are in kilobytes.<\/p>\n<p><strong>total <\/strong>represents the total memory installed on your system<\/p>\n<p><strong>used<\/strong> how much memory is currently using by running tasks ( you can calculate used memory = total \u2013 free \u2013 buffer\/cache)<\/p>\n<p><strong>free <\/strong>represents the memory that is not being used<\/p>\n<p><strong>shared<\/strong> shows the amount of memory that is being shared by different multiple processes<\/p>\n<p><strong>Buffers <\/strong>amount of memory which is reserved by the OS kernel. This memory is further allocated as buffers when process will need<\/p>\n<p><strong>cached <\/strong>how much memory is used to store recently files in RAM<\/p>\n<p><strong>buff\/cache <\/strong>Buffers + Cache memory<\/p>\n<p><strong>Available <\/strong>shows memory which is available for starting new tasks, without swapping.<\/p>\n<p>Using the following command you can explore a complete description and all options of free command:<\/p>\n<p>$ man free<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1090\" height=\"736\" class=\"wp-image-1927\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-547.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-547.png 1090w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-547-300x203.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-547-1024x691.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-547-768x519.png 768w\" sizes=\"auto, (max-width: 1090px) 100vw, 1090px\" \/><\/p>\n<h2><strong>Use of vmstat Command<\/strong><\/h2>\n<p>The vmstat command is used to display complete statistics of virtual memory.<\/p>\n<p>This command gives the information about the memory, system processes, CPU activity, paging, block IO, and traps.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1098\" height=\"166\" class=\"wp-image-1928\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-548.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-548.png 1098w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-548-300x45.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-548-1024x155.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-548-768x116.png 768w\" sizes=\"auto, (max-width: 1098px) 100vw, 1098px\" \/><\/p>\n<h2><strong>Use of top command<\/strong><\/h2>\n<p>Top command is a very useful command line tool&nbsp;that is used to examine the memory and CPU usage per process. It displays the information about the following things:<\/p>\n<ul>\n<li>uptime<\/li>\n<li>average load<\/li>\n<li>tasks running<\/li>\n<li>Information about the of users logged in<\/li>\n<li>number of CPU utilization<\/li>\n<li>Swap and memory\/ system processes<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1929\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-549.png\" alt=\"Check memory usage\" width=\"1096\" height=\"747\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-549.png 1096w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-549-300x204.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-549-1024x698.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-549-768x523.png 768w\" sizes=\"auto, (max-width: 1096px) 100vw, 1096px\" \/><\/p>\n<p>Using the above top command, data is updated in a continuous manner, which allows you to monitor the memory for the processes in a real-time.<\/p>\n<h2><strong>Use of htop command<\/strong><\/h2>\n<p>The htop command provides similar information like the top command. However, one of the main advantages of the htop command is that it offers a user-friendly environment and improved control options.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1930\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-550.png\" alt=\"Check memory usage\" width=\"1104\" height=\"766\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-550.png 1104w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-550-300x208.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-550-1024x710.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-550-768x533.png 768w\" sizes=\"auto, (max-width: 1104px) 100vw, 1104px\" \/><\/p>\n<p>For interactive interface, the htop command uses colors for displaying its output, gives a full command line environment for all processes, as well as it has the option to scroll the page both horizontally and vertically. Press Ctrl+c to exit from the current window.<\/p>\n<p>You will see the following screen on your terminal:<\/p>\n<ol>\n<li>The top section provides the information summary and contains graphic text counters.<\/li>\n<li>The middle section displays the detailed data of per process. It allows you to easily perform the separate actions on every individual process.<\/li>\n<li>All shortcuts are listed at the bottom of the displaying window that will enable you to customize and manipulate the processes quickly without using any command.<\/li>\n<\/ol>\n<p>If this utility is not installed on your CentOS 8 system then, using the following command you can install it on your system:<\/p>\n<pre>$ sudo yum install htop&nbsp;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1096\" height=\"746\" class=\"wp-image-1931\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-551.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-551.png 1096w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-551-300x204.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-551-1024x697.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-551-768x523.png 768w\" sizes=\"auto, (max-width: 1096px) 100vw, 1096px\" \/><\/p>\n<h2><strong>Check Memory using GUI<\/strong><\/h2>\n<p>If you want to check memory using the graphical user interface then, using the following method you can easily perform this action:<\/p>\n<p>Type \u2018system monitor\u2019 in the application search bar.&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"759\" height=\"343\" class=\"wp-image-1932\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-552.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-552.png 759w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-552-300x136.png 300w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/p>\n<p>Click on the above displaying icon. The following window will open on your system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1048\" height=\"815\" class=\"wp-image-1933\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-553.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-553.png 1048w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-553-300x233.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-553-1024x796.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-553-768x597.png 768w\" sizes=\"auto, (max-width: 1048px) 100vw, 1048px\" \/><\/p>\n<p>Select the \u2018Resources\u2019 tab where you can easily monitor the memory usage.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1934\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-554.png\" alt=\"Check memory usage\" width=\"1047\" height=\"815\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-554.png 1047w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-554-300x234.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-554-1024x797.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/11\/word-image-554-768x598.png 768w\" sizes=\"auto, (max-width: 1047px) 100vw, 1047px\" \/><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Today, we have learned in this article how to check the memory usage on the CentOS 8 system. Moreover, we have executed different commands such as cat, free, vmstat, top and htop that are used to display the memory information. Using these commands, you can easily get information about your system RAM, and CPU. Thanks for reading the above article.<\/p>\n<p><strong><a href=\"https:\/\/linuxways.net\/de\/mint\/4-ways-to-check-memory-usage-in-linux-mint-20\/\">Click here if you would like to check memory usage on Linux Mint 20.<\/a><\/strong><\/p>\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Sometimes, when you are working on a Linux environment, you may need to install some new packages on a daily basis. For this purpose, you need to check&hellip;<\/p>","protected":false},"author":2,"featured_media":2022,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[38],"class_list":["post-1924","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/1924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=1924"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/1924\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/2022"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=1924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=1924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=1924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}