View memory usage in centos

Source: Internet
Author: User

View memory usage in centos

In Linux, the free command is generally used to view the memory usage. The parameter-M is used to display the content in MB. This content is actually exquisite. For example:

The content is divided into three n columns. The first row indicates the overall memory usage, and the second row indicates the usage of memory-/+ buffers/cache, the third row indicates the usage of swap partitions. Each column shows the usage of each category. The total column indicates the total memory size, used column indicates the number of memory in use... and so on. We need to focus on the second line. 2564 in the used column of the second row indicates the number of memory in use-the memory after buffers-Cache (that is, used-Buffers-cache in each row), 1388 in the free column of the second row, indicates the number of available memory + buffers + cache memory (that is, free + buffers + cache in the first line). Therefore, The actual memory used by the server is 2564 MB, and the memory not used is 1388 MB.! Why? We know that buffer and cache are the Cache Technology in Linux. What are the differences between these two caches? I am not very clear about them as long as I know that they are all used for caching. The number of memory in each column in the first row is reflected by the system. For the system, the buffer and cache are allocated memory, so they belong to used (used ); the memory of each column in the second row is not the same. They are the memory size after-/+ buffer/cache. For programs, both buffer and cache are available memory, because they are designed as pre-allocated memory to improve performance, they are all available, that is, free. Therefore, the used-buffer-cache in the first row gets the number in the used column in the second row, which is the memory actually used by the program; and the free + buffer + cache in the first row, the number in the free column in the second row is obtained, which is the memory that can be used by the program.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.